tpm_tis: fix the error handling of init_tis()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 7 Feb 2017 15:51:47 +0000 (15:51 +0000)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 14 Feb 2017 17:24:33 +0000 (19:24 +0200)
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")
Cc: stable@vger.kernel.org
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm_tis.c

index 7912dad..c7e1384 100644 (file)
@@ -432,7 +432,7 @@ err_pnp:
        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);