Skip to contentSkip to conversation

pinctrl: mediatek: uninitialized variable in mtk_pctrl_show_one_pin()

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: uninitialized variable in mtk_pctrl_show_one_pin()

The "try_all_type" variable is not set if (hw->soc->pull_type) is false leading to the following Smatch warning:

drivers/pinctrl/mediatek/pinctrl-paris.c:599 mtk_pctrl_show_one_pin()
error: uninitialized symbol 'try_all_type'.

Fixes fb34a9ae383a ("pinctrl: mediatek: support rsel feature")
---
 drivers/pinctrl/mediatek/pinctrl-paris.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/mediatek/pinctrl-paris.c +1 -1
index d4e02c5d74a8..4c6f6d967b18 100644
@@ -581,7 +581,7 @@ ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw,
 {
 	int pinmux, pullup, pullen, len = 0, r1 = -1, r0 = -1, rsel = -1;
 	const struct mtk_pin_desc *desc;
-	u32 try_all_type;
+	u32 try_all_type = 0;
 
 	if (gpio >= hw->soc->npins)
 		return -EINVAL;
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

The "try_all_type" variable is not set if (hw->soc->pull_type) is false leading to the following Smatch warning:

drivers/pinctrl/mediatek/pinctrl-paris.c:599 mtk_pctrl_show_one_pin()
error: uninitialized symbol 'try_all_type'.

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

Patch applied.

Yours,
Linus Walleij