diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2024-08-19 04:46:25 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2024-08-24 16:28:38 +0200 |
commit | cacd8cf79d7823b07619865e994a7916fcc8ae91 (patch) | |
tree | ad9e8e9782ee8c7d095696cc363d46895831c2cb /drivers/pinctrl/pinctrl-single.c | |
parent | pinctrl: imx: Switch to LATE_SYSTEM_SLEEP_PM_OPS() (diff) | |
download | linux-cacd8cf79d7823b07619865e994a7916fcc8ae91.tar.xz linux-cacd8cf79d7823b07619865e994a7916fcc8ae91.zip |
pinctrl: single: fix missing error code in pcs_probe()
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>
Diffstat (limited to 'drivers/pinctrl/pinctrl-single.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-single.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 4c6bfabb6bd7..fcac0c03905c 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -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; |