diff options
author | Guodong Liu <Guodong.Liu@mediatek.com> | 2023-01-18 14:20:36 +0800 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2023-01-26 14:39:35 +0100 |
commit | 2e34f82ba214134ecf590fbe0cdbd87401645a8a (patch) | |
tree | a9301114ae5b456a2a41a5c08eac3416d8740038 /drivers/pinctrl/mediatek | |
parent | a298c70a10c604a6b3df5a0aa56597b705ba0f6b (diff) | |
download | lwn-2e34f82ba214134ecf590fbe0cdbd87401645a8a.tar.gz lwn-2e34f82ba214134ecf590fbe0cdbd87401645a8a.zip |
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: 184d8e13f9b1 ("pinctrl: mediatek: Add support for pin configuration dump via debugfs.")
Signed-off-by: Guodong Liu <Guodong.Liu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230118062036.26258-3-Guodong.Liu@mediatek.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mediatek')
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-paris.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c index bc0bf5aedc54..33d6c3fb7908 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.c +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c @@ -717,7 +717,7 @@ static void mtk_pctrl_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, unsigned int gpio) { struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev); - char buf[PIN_DBG_BUF_SZ]; + char buf[PIN_DBG_BUF_SZ] = { 0 }; (void)mtk_pctrl_show_one_pin(hw, gpio, buf, PIN_DBG_BUF_SZ); |