Skip to content

Commit 2e34f82

Browse files
Guodong Liulinusw
authored andcommitted
pinctrl: mediatek: Initialize variable *buf to zero
Coverity spotted that *buf is not initialized to zero in mtk_pctrl_dbg_show. Using uninitialized variable *buf as argument to %s when calling seq_printf. Fix this coverity by initializing *buf 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 a298c70 commit 2e34f82

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
@@ -717,7 +717,7 @@ static void mtk_pctrl_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
717717
unsigned int gpio)
718718
{
719719
struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev);
720-
char buf[PIN_DBG_BUF_SZ];
720+
char buf[PIN_DBG_BUF_SZ] = { 0 };
721721

722722
(void)mtk_pctrl_show_one_pin(hw, gpio, buf, PIN_DBG_BUF_SZ);
723723

0 commit comments

Comments
 (0)