pinctrl: mediatek: paris: handle mtk_hw_set_value() errors in mtk_pmx_set_mux()
authorKarina Yankevich <k.yankevich@omp.ru>
Fri, 22 Sep 2023 13:59:25 +0000 (16:59 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 27 Sep 2023 08:39:29 +0000 (10:39 +0200)
mtk_pmx_set_mux() doesn't check the result of mtk_hw_set_value()
despite it may return negative error code. Propagate error code
to caller functions.

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

Signed-off-by: Karina Yankevich <k.yankevich@omp.ru>
Link: https://lore.kernel.org/r/20230922135926.3653428-1-k.yankevich@omp.ru
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/mediatek/pinctrl-paris.c

index 33d6c3fb79080a9286e0ab14c0fecb76d9a92c1e..b7cb5a1f1060f672ef8559d05d5fa4f7c2bc6d0e 100644 (file)
@@ -779,9 +779,7 @@ static int mtk_pmx_set_mux(struct pinctrl_dev *pctldev,
                return -EINVAL;
 
        desc = (const struct mtk_pin_desc *)&hw->soc->pins[grp->pin];
-       mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_MODE, desc_func->muxval);
-
-       return 0;
+       return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_MODE, desc_func->muxval);
 }
 
 static const struct pinmux_ops mtk_pmxops = {