Skip to contentSkip to conversation

pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel()

PATCH In review Dan Carpenter 2 participants 2 messages Nov 27, 2021 – Dec 2, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel()

All the other mtk_hw_get_value() calls have a check for "if (err)" so we can add one here as well. This silences a Smatch warning:

drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:819 mtk_pinconf_bias_get_rsel()
error: uninitialized symbol 'pd'.

Fixes fb34a9ae383a ("pinctrl: mediatek: support rsel feature")
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +2 -0
index 53779822348d..e1ae3beb9f72 100644
@@ -815,6 +815,8 @@ static int mtk_pinconf_bias_get_rsel(struct mtk_pinctrl *hw,
 		goto out;
 
 	err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd);
+	if (err)
+		goto out;
 
 	if (pu == 0 && pd == 0) {
 		*pullup = 0;
Signature · 7 lines
2.20.1


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#1 lore raw
Quoted 8 lines · Dan Carpenter

All the other mtk_hw_get_value() calls have a check for "if (err)" so we can add one here as well. This silences a Smatch warning:

drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:819 mtk_pinconf_bias_get_rsel()
error: uninitialized symbol 'pd'.

Fixes fb34a9ae383a ("pinctrl: mediatek: support rsel feature")

Patch applied.

Yours,
Linus Walleij