* [PATCH] tpm_nsc: Fix bugzilla 34572
@ 2011-07-22 21:39 Stefan Berger
2011-07-25 0:41 ` James Morris
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Berger @ 2011-07-22 21:39 UTC (permalink / raw)
To: Rajiv Andrade; +Cc: James Morris, baryluk, linux-kernel
This patch fixes kernel bugzilla 34572. It applies to the tip of Linus's tree.
https://bugzilla.kernel.org/show_bug.cgi?id=34572
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: Witold Baryluk <baryluk@smp.if.uj.edu.pl>
---
drivers/char/tpm/tpm_nsc.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Index: linux-2.6/drivers/char/tpm/tpm_nsc.c
===================================================================
--- linux-2.6.orig/drivers/char/tpm/tpm_nsc.c
+++ linux-2.6/drivers/char/tpm/tpm_nsc.c
@@ -330,12 +330,12 @@ static int __init init_nsc(void)
pdev->dev.driver = &nsc_drv.driver;
pdev->dev.release = tpm_nsc_remove;
- if ((rc = platform_device_register(pdev)) < 0)
- goto err_free_dev;
+ if ((rc = platform_device_add(pdev)) < 0)
+ goto err_put_dev;
if (request_region(base, 2, "tpm_nsc0") == NULL ) {
rc = -EBUSY;
- goto err_unreg_dev;
+ goto err_del_dev;
}
if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_nsc))) {
@@ -382,10 +382,10 @@ static int __init init_nsc(void)
err_rel_reg:
release_region(base, 2);
-err_unreg_dev:
- platform_device_unregister(pdev);
-err_free_dev:
- kfree(pdev);
+err_del_dev:
+ platform_device_del(pdev);
+err_put_dev:
+ platform_device_put(pdev);
err_unreg_drv:
platform_driver_unregister(&nsc_drv);
return rc;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] tpm_nsc: Fix bugzilla 34572
2011-07-22 21:39 [PATCH] tpm_nsc: Fix bugzilla 34572 Stefan Berger
@ 2011-07-25 0:41 ` James Morris
0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2011-07-25 0:41 UTC (permalink / raw)
To: Stefan Berger; +Cc: Rajiv Andrade, baryluk, linux-kernel
On Fri, 22 Jul 2011, Stefan Berger wrote:
> This patch fixes kernel bugzilla 34572. It applies to the tip of Linus's tree.
>
> https://bugzilla.kernel.org/show_bug.cgi?id=34572
>
A complete explanation of the patch should be included in the changelog
here (as well as the subject line).
> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> Tested-by: Witold Baryluk <baryluk@smp.if.uj.edu.pl>
I'll push it to Linus with the rest of the security tree.
>
> ---
> drivers/char/tpm/tpm_nsc.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> Index: linux-2.6/drivers/char/tpm/tpm_nsc.c
> ===================================================================
> --- linux-2.6.orig/drivers/char/tpm/tpm_nsc.c
> +++ linux-2.6/drivers/char/tpm/tpm_nsc.c
> @@ -330,12 +330,12 @@ static int __init init_nsc(void)
> pdev->dev.driver = &nsc_drv.driver;
> pdev->dev.release = tpm_nsc_remove;
>
> - if ((rc = platform_device_register(pdev)) < 0)
> - goto err_free_dev;
> + if ((rc = platform_device_add(pdev)) < 0)
> + goto err_put_dev;
>
> if (request_region(base, 2, "tpm_nsc0") == NULL ) {
> rc = -EBUSY;
> - goto err_unreg_dev;
> + goto err_del_dev;
> }
>
> if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_nsc))) {
> @@ -382,10 +382,10 @@ static int __init init_nsc(void)
>
> err_rel_reg:
> release_region(base, 2);
> -err_unreg_dev:
> - platform_device_unregister(pdev);
> -err_free_dev:
> - kfree(pdev);
> +err_del_dev:
> + platform_device_del(pdev);
> +err_put_dev:
> + platform_device_put(pdev);
> err_unreg_drv:
> platform_driver_unregister(&nsc_drv);
> return rc;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-25 0:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-22 21:39 [PATCH] tpm_nsc: Fix bugzilla 34572 Stefan Berger
2011-07-25 0:41 ` James Morris
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.