[PATCH] tpm: ibmvtpm: free irq on the error path in tpm_ibmvtpm_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux