]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pinctrl: single: fix missing error code in pcs_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 19 Aug 2024 02:46:25 +0000 (10:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:33:07 +0000 (16:33 +0200)
[ Upstream commit cacd8cf79d7823b07619865e994a7916fcc8ae91 ]

If pinctrl_enable() fails in pcs_probe(), it should return the error code.

Fixes: 8f773bfbdd42 ("pinctrl: single: fix possible memory leak when pinctrl_enable() fails")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/20240819024625.154441-1-yangyingliang@huaweicloud.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/pinctrl-single.c

index 4da3c3f422b6910d56bce40b6c7a81cac0dd8b72..2ec599e383e4b2d463725b8baf4bb8bbcdc4c9f1 100644 (file)
@@ -1913,7 +1913,8 @@ static int pcs_probe(struct platform_device *pdev)
 
        dev_info(pcs->dev, "%i pins, size %u\n", pcs->desc.npins, pcs->size);
 
-       if (pinctrl_enable(pcs->pctl))
+       ret = pinctrl_enable(pcs->pctl);
+       if (ret)
                goto free;
 
        return 0;