diff mbox

[tpmdd-devel,-next] tpm_tis: fix the error handling of init_tis()

Message ID 20170207155147.2581-1-weiyj.lk@gmail.com
State New
Headers show

Commit Message

Wei Yongjun Feb. 7, 2017, 3:51 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Add the missing platform_driver_unregister() and remove the duplicate
platform_device_unregister(force_pdev) in the error handling case.

Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/char/tpm/tpm_tis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

Comments

Jason Gunthorpe Feb. 7, 2017, 5:05 p.m. UTC | #1
On Tue, Feb 07, 2017 at 03:51:47PM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Add the missing platform_driver_unregister() and remove the duplicate
> platform_device_unregister(force_pdev) in the error handling case.
> 
> Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>  drivers/char/tpm/tpm_tis.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Yep. Thanks

Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Jason

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Jarkko Sakkinen Feb. 8, 2017, 11:36 a.m. UTC | #2
On Tue, Feb 07, 2017 at 03:51:47PM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Add the missing platform_driver_unregister() and remove the duplicate
> platform_device_unregister(force_pdev) in the error handling case.
> 
> Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko

> ---
>  drivers/char/tpm/tpm_tis.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index 7912dad..c7e1384 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -432,7 +432,7 @@ static int __init init_tis(void)
>  	acpi_bus_unregister_driver(&tis_acpi_driver);
>  err_acpi:
>  #endif
> -	platform_device_unregister(force_pdev);
> +	platform_driver_unregister(&tis_drv);
>  err_platform:
>  	if (force_pdev)
>  		platform_device_unregister(force_pdev);
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Jarkko Sakkinen Feb. 8, 2017, 11:38 a.m. UTC | #3
On Wed, Feb 08, 2017 at 01:36:37PM +0200, Jarkko Sakkinen wrote:
> On Tue, Feb 07, 2017 at 03:51:47PM +0000, Wei Yongjun wrote:
> > From: Wei Yongjun <weiyongjun1@huawei.com>
> > 
> > Add the missing platform_driver_unregister() and remove the duplicate
> > platform_device_unregister(force_pdev) in the error handling case.
> > 
> > Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

I applied this and added cc to stable.

/Jarkko

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
diff mbox

Patch

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 7912dad..c7e1384 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -432,7 +432,7 @@  static int __init init_tis(void)
 	acpi_bus_unregister_driver(&tis_acpi_driver);
 err_acpi:
 #endif
-	platform_device_unregister(force_pdev);
+	platform_driver_unregister(&tis_drv);
 err_platform:
 	if (force_pdev)
 		platform_device_unregister(force_pdev);