* [PATCH] tpm: ibmvtpm: free irq on the error path in tpm_ibmvtpm_probe()
@ 2022-11-19 10:46 Gaosheng Cui
0 siblings, 0 replies; only message in thread
From: Gaosheng Cui @ 2022-11-19 10:46 UTC (permalink / raw)
To: mpe, npiggin, christophe.leroy, peterhuewe, jarkko, jgg, adlai,
key, cuigaosheng1
Cc: linuxppc-dev, linux-integrity
In tpm_ibmvtpm_probe(), vio_dev->irq has not been freed on the
init_irq_cleanup error path, we need to free it. Fix it.
Fixes: 132f76294744 ("drivers/char/tpm: Add new device driver to support IBM vTPM")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
---
drivers/char/tpm/tpm_ibmvtpm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
index d3989b257f42..8c23aabdfc24 100644
--- a/drivers/char/tpm/tpm_ibmvtpm.c
+++ b/drivers/char/tpm/tpm_ibmvtpm.c
@@ -649,7 +649,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
tpm_ibmvtpm_driver_name, ibmvtpm);
if (rc) {
dev_err(dev, "Error %d register irq 0x%x\n", rc, vio_dev->irq);
- goto init_irq_cleanup;
+ goto req_irq_cleanup;
}
rc = vio_enable_interrupts(vio_dev);
@@ -702,6 +702,8 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
return tpm_chip_register(chip);
init_irq_cleanup:
+ free_irq(vio_dev->irq, ibmvtpm);
+req_irq_cleanup:
do {
rc1 = plpar_hcall_norets(H_FREE_CRQ, vio_dev->unit_address);
} while (rc1 == H_BUSY || H_IS_LONG_BUSY(rc1));
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-19 10:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-19 10:46 [PATCH] tpm: ibmvtpm: free irq on the error path in tpm_ibmvtpm_probe() Gaosheng Cui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).