Skip to contentSkip to conversation

tpm_tis: fix the error handling of init_tis()

PATCH Applied Wei Yongjun 3 participants 4 messages Feb 7, 2017 – Feb 8, 2017 TPM device driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm_tis: fix the error handling of init_tis()

From: Wei Yongjun <[email protected]>

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")
---
 drivers/char/tpm/tpm_tis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_tis.c +1 -1
index 7912dad..c7e1384 100644
@@ -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);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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")
 drivers/char/tpm/tpm_tis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Yep. Thanks

Jason

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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Wei Yongjun
Quoted 7 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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")

/Jarkko

Quoted 10 lines
---
 drivers/char/tpm/tpm_tis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_tis.c +0 -0
index 7912dad..c7e1384 100644

drivers/char/tpm/tpm_tis.c static int __init init_tis(void) · line 438

Quoted 8 lines
drivers/char/tpm/tpm_tis.c +1 -1
@@ -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

#3 lore raw
Quoted 10 lines · Jarkko Sakkinen
Quoted 7 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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")

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