From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Carlo Caione <carlo@caione.org>,
Kevin Hilman <khilman@baylibre.com>,
linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org
Subject: Re: [PATCH] pinctrl: meson: Drop pinctrl_unregister for devm_ registered device
Date: Tue, 26 Jul 2016 10:00:53 -0700 [thread overview]
Message-ID: <20160726170053.GA40841@dtor-ws> (raw)
In-Reply-To: <1469544718-32001-1-git-send-email-weiyj.lk@gmail.com>
On Tue, Jul 26, 2016 at 02:51:58PM +0000, Wei Yongjun wrote:
> It's not necessary to unregister pin controller device registered
> with devm_pinctrl_register() and using pinctrl_unregister() leads
> to a double free.
>
> This is detected by Coccinelle semantic patch.
>
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Fixes: e649f7ec8c5f ("pinctrl: meson: Use devm_pinctrl_register() for
pinctrl registration")
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> drivers/pinctrl/meson/pinctrl-meson.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
> index 11623c6..44e69c9 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson.c
> @@ -727,13 +727,7 @@ static int meson_pinctrl_probe(struct platform_device *pdev)
> return PTR_ERR(pc->pcdev);
> }
>
> - ret = meson_gpiolib_register(pc);
> - if (ret) {
> - pinctrl_unregister(pc->pcdev);
> - return ret;
> - }
> -
> - return 0;
> + return meson_gpiolib_register(pc);
> }
>
> static struct platform_driver meson_pinctrl_driver = {
>
Thanks.
--
Dmitry
next prev parent reply other threads:[~2016-07-26 17:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-26 14:51 [PATCH] pinctrl: meson: Drop pinctrl_unregister for devm_ registered device Wei Yongjun
2016-07-26 17:00 ` Dmitry Torokhov [this message]
2016-07-26 21:56 ` Kevin Hilman
2016-08-04 8:10 ` Linus Walleij
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=20160726170053.GA40841@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=carlo@caione.org \
--cc=khilman@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=weiyj.lk@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).