Skip to content

Commit a298c70

Browse files
Guodong Liulinusw
authored andcommitted
pinctrl: mediatek: Initialize variable pullen and pullup to zero
Coverity spotted that pullen and pullup is not initialized to zero in mtk_pctrl_show_one_pin. The uninitialized variable pullen is used in assignment statement "rsel = pullen;" in mtk_pctrl_show_one_pin, and Uninitialized variable pullup is used when calling scnprintf. Fix this coverity by initializing pullen and pullup as zero. Fixes: 184d8e1 ("pinctrl: mediatek: Add support for pin configuration dump via debugfs.") Signed-off-by: Guodong Liu <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 9bd73ce commit a298c70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pinctrl/mediatek/pinctrl-paris.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ static int mtk_hw_get_value_wrap(struct mtk_pinctrl *hw, unsigned int gpio, int
640640
ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw,
641641
unsigned int gpio, char *buf, unsigned int buf_len)
642642
{
643-
int pinmux, pullup, pullen, len = 0, r1 = -1, r0 = -1, rsel = -1;
643+
int pinmux, pullup = 0, pullen = 0, len = 0, r1 = -1, r0 = -1, rsel = -1;
644644
const struct mtk_pin_desc *desc;
645645
u32 try_all_type = 0;
646646

0 commit comments

Comments
 (0)