From: Kent Yoder <shpedoikal@gmail.com>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: key@linux.vnet.ibm.com, mail@srajiv.net, tpmdd@selhorst.net,
tpmdd@sirrix.com, yongjun_wei@trendmicro.com.cn,
tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [tpmdd-devel] [PATCH] tpm_tis: missing platform_driver_unregister() on error in init_tis()
Date: Fri, 26 Apr 2013 09:28:15 -0500 [thread overview]
Message-ID: <20130426142814.GA19153@gmail.com> (raw)
In-Reply-To: <CAPgLHd9-Ji3TaH9iFGt7d0R3rtQMkbmMvYQnSwwcehEn1=qP5g@mail.gmail.com>
On Thu, Apr 25, 2013 at 03:07:47PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Add the missing platform_driver_unregister() before return
> from init_tis() in the device register error handling case.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Applied and staged here, thanks!
git://github.com/shpedoikal/linux.git tpmdd-04-26-13
Kent
> ---
> drivers/char/tpm/tpm_tis.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index 8a41b6b..2f777a4 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -884,13 +884,20 @@ static int __init init_tis(void)
> rc = platform_driver_register(&tis_drv);
> if (rc < 0)
> return rc;
> - if (IS_ERR(pdev=platform_device_register_simple("tpm_tis", -1, NULL, 0)))
> - return PTR_ERR(pdev);
> - if((rc=tpm_tis_init(&pdev->dev, TIS_MEM_BASE, TIS_MEM_LEN, 0)) != 0) {
> - platform_device_unregister(pdev);
> - platform_driver_unregister(&tis_drv);
> + pdev = platform_device_register_simple("tpm_tis", -1, NULL, 0);
> + if (IS_ERR(pdev)) {
> + rc = PTR_ERR(pdev);
> + goto err_dev;
> }
> - return rc;
> + rc = tpm_tis_init(&pdev->dev, TIS_MEM_BASE, TIS_MEM_LEN, 0);
> + if (rc)
> + goto err_init;
> + return 0;
> +err_init:
> + platform_device_unregister(pdev);
> +err_dev:
> + platform_driver_unregister(&tis_drv);
> + return rc;
> }
>
> static void __exit cleanup_tis(void)
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
> _______________________________________________
> tpmdd-devel mailing list
> tpmdd-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tpmdd-devel
prev parent reply other threads:[~2013-04-26 14:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-25 7:07 [PATCH] tpm_tis: missing platform_driver_unregister() on error in init_tis() Wei Yongjun
2013-04-26 14:28 ` Kent Yoder [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130426142814.GA19153@gmail.com \
--to=shpedoikal@gmail.com \
--cc=key@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mail@srajiv.net \
--cc=tpmdd-devel@lists.sourceforge.net \
--cc=tpmdd@selhorst.net \
--cc=tpmdd@sirrix.com \
--cc=weiyj.lk@gmail.com \
--cc=yongjun_wei@trendmicro.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.