[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <51825086.3010205@huawei.com>
Date: Thu, 2 May 2013 19:39:50 +0800
From: Libo Chen <clbchenlibo.chen@...wei.com>
To: <key@...ux.vnet.ibm.com>, <mail@...jiv.net>, <tpmdd@...horst.net>,
<tpmdd@...rix.com>
CC: <tpmdd-devel@...ts.sourceforge.net>,
<linux-kernel@...r.kernel.org>, Li Zefan <lizefan@...wei.com>
Subject: [PATCH] tpm_tis: fix missing platform_driver_unregister
Add missing unregister tis_drv after register pdev fail
Signed-off-by: Libo Chen <libo.chen@...wei.com>
---
drivers/char/tpm/tpm_tis.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 8a41b6b..d5b0af4 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -884,8 +884,11 @@ static int __init init_tis(void)
rc = platform_driver_register(&tis_drv);
if (rc < 0)
return rc;
- if (IS_ERR(pdev=platform_device_register_simple("tpm_tis", -1, NULL, 0)))
- return PTR_ERR(pdev);
+ pdev = platform_device_register_simple("tpm_tis", -1, NULL, 0);
+ if (IS_ERR(pdev) {
+ platform_driver_unregister(&tis_drv);
+ return PTR_ERR(pdev);
+ }
if((rc=tpm_tis_init(&pdev->dev, TIS_MEM_BASE, TIS_MEM_LEN, 0)) != 0) {
platform_device_unregister(pdev);
platform_driver_unregister(&tis_drv);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists