[tpmdd-devel,2/6] tpm_tis: free irq after probing
diff mbox

Message ID 1446740353-15235-3-git-send-email-martin.wilck@ts.fujitsu.com
State New
Headers show

Commit Message

Martin Wilck Nov. 5, 2015, 4:19 p.m. UTC
From: Martin Wilck <Martin.Wilck@ts.fujitsu.com>

Release IRQs used for probing only. Otherwise the TPM will end up
with all IRQs 3-15 assigned.

Signed-off-by: Martin Wilck <Martin.Wilck@ts.fujitsu.com>
---
 drivers/char/tpm/tpm_tis.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jarkko Sakkinen Nov. 5, 2015, 9:50 p.m. UTC | #1
On Thu, Nov 05, 2015 at 05:19:09PM +0100, martin.wilck@ts.fujitsu.com wrote:
> From: Martin Wilck <Martin.Wilck@ts.fujitsu.com>
> 
> Release IRQs used for probing only. Otherwise the TPM will end up
> with all IRQs 3-15 assigned.

Good catch!

I applied it here https://github.com/jsakkine/linux-tpmdd/tree/fixes

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fixes: afb5abc262e9 ("tpm: two-phase chip management functions")

> Signed-off-by: Martin Wilck <Martin.Wilck@ts.fujitsu.com>

/Jarkko

------------------------------------------------------------------------------

Patch
diff mbox

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 3ed7e6ce..474f752 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -831,6 +831,8 @@  static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 			iowrite32(intmask,
 				  chip->vendor.iobase +
 				  TPM_INT_ENABLE(chip->vendor.locality));
+
+			devm_free_irq(dev, i, chip);
 		}
 	}
 	if (chip->vendor.irq) {