[PATCH 1/2] TPM: Missing put_device()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rajiv Andrade
Date: Wednesday, September 24, 2008 - 12:34 pm

In case one calling tpm_open() whilst other process is owning it,
the refcount wouldn't get 0.

This patch depends on [PATCH 3/4][resubmit] TPM: rcu locking, sent on 23 Sep 2008.

Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
---
 drivers/char/tpm/tpm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index f6bbc1d..ab03b4d 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -979,6 +979,7 @@ int tpm_open(struct inode *inode, struct file *file)
 
 	if (test_and_set_bit(0, &chip->is_open)) {
 		dev_dbg(chip->dev, "Another process owns this TPM\n");
+		put_device(chip->dev);
 		return -EBUSY;
 	}
 
-- 
1.5.6.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/2] TPM: Missing put_device(), Rajiv Andrade, (Wed Sep 24, 12:34 pm)
[PATCH 2/2] TPM: Fixed tpm release timing, Rajiv Andrade, (Wed Sep 24, 12:34 pm)