Commit 78b20161 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

pinctrl: meson: Drop pinctrl_unregister for devm_ registered device

commit 5b236d0f 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: e649f7ec ("pinctrl: meson: Use devm_pinctrl_register() for pinctrl registration")
Signed-off-by: default avatarWei Yongjun <weiyj.lk@gmail.com>
Reviewed-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: default avatarKevin Hilman <khilman@baylibre.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fcc5540e
...@@ -727,13 +727,7 @@ static int meson_pinctrl_probe(struct platform_device *pdev) ...@@ -727,13 +727,7 @@ static int meson_pinctrl_probe(struct platform_device *pdev)
return PTR_ERR(pc->pcdev); return PTR_ERR(pc->pcdev);
} }
ret = meson_gpiolib_register(pc); return meson_gpiolib_register(pc);
if (ret) {
pinctrl_unregister(pc->pcdev);
return ret;
}
return 0;
} }
static struct platform_driver meson_pinctrl_driver = { static struct platform_driver meson_pinctrl_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment