]> www.infradead.org Git - users/jedix/linux-maple.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)
committerLinus Walleij <linus.walleij@linaro.org>
Sat, 24 Aug 2024 14:28:38 +0000 (16:28 +0200)
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>
drivers/pinctrl/pinctrl-single.c

index 4c6bfabb6bd7d8d14fcc6732f0c424e0e178d412..fcac0c03905c0c78068fae212c551734b1139d6f 100644 (file)
@@ -1911,7 +1911,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;