[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160905164433.289700308@linuxfoundation.org>
Date: Mon, 5 Sep 2016 18:43:59 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Wei Yongjun <weiyj.lk@...il.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Kevin Hilman <khilman@...libre.com>,
Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH 4.7 063/143] pinctrl: meson: Drop pinctrl_unregister for devm_ registered device
4.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <weiyj.lk@...il.com>
commit 5b236d0fde21d88351420ef0b9a6cb7aeeea0c54 upstream.
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.
Fixes: e649f7ec8c5f ("pinctrl: meson: Use devm_pinctrl_register() for pinctrl registration")
Signed-off-by: Wei Yongjun <weiyj.lk@...il.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
Acked-by: Kevin Hilman <khilman@...libre.com>
Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/pinctrl/meson/pinctrl-meson.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -727,13 +727,7 @@ static int meson_pinctrl_probe(struct pl
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 = {
Powered by blists - more mailing lists