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

From: Rajiv Andrade
Date: Wed Sep 24 2008 - 15:38:53 EST


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@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Rajiv Andrade <srajiv@xxxxxxxxxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/