| From 20c7cb4837ee2d7d0f90dd5ace2c0d5af1f1d56d Mon Sep 17 00:00:00 2001 |
| From: Wei Yongjun <weiyongjun1@huawei.com> |
| Date: Tue, 7 Feb 2017 15:51:47 +0000 |
| Subject: [PATCH] tpm_tis: fix the error handling of init_tis() |
| |
| commit 5939eaf4f9d432586dd2cdeea778506471e8088e upstream. |
| |
| 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> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c |
| index eaf5730d79eb..8022bea27fed 100644 |
| --- a/drivers/char/tpm/tpm_tis.c |
| +++ b/drivers/char/tpm/tpm_tis.c |
| @@ -421,7 +421,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); |
| -- |
| 2.12.0 |
| |