diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-08-03 19:58:07 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2011-09-22 19:46:17 -0400 |
commit | de69113ec1896443c732e8b812e8005fb44eeeeb (patch) | |
tree | 9885a62b06d34dd407deb1c6c597a4f8ed73153a | |
parent | 5ce5ed35939ece8a9c7e0f10c7f3d5bc000c6b64 (diff) |
TPM: tpm_nsc: Fix a double free of pdev in cleanup_nsc
platform_device_unregister() will release all resources
and remove it from the subsystem, then drop reference count by
calling platform_device_put().
We should not call kfree(pdev) after platform_device_unregister(pdev).
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
-rw-r--r-- | drivers/char/tpm/tpm_nsc.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c index 82facc9104c7..4d2464871ada 100644 --- a/drivers/char/tpm/tpm_nsc.c +++ b/drivers/char/tpm/tpm_nsc.c | |||
@@ -396,8 +396,6 @@ static void __exit cleanup_nsc(void) | |||
396 | if (pdev) { | 396 | if (pdev) { |
397 | tpm_nsc_remove(&pdev->dev); | 397 | tpm_nsc_remove(&pdev->dev); |
398 | platform_device_unregister(pdev); | 398 | platform_device_unregister(pdev); |
399 | kfree(pdev); | ||
400 | pdev = NULL; | ||
401 | } | 399 | } |
402 | 400 | ||
403 | platform_driver_unregister(&nsc_drv); | 401 | platform_driver_unregister(&nsc_drv); |