* [PATCH] pinctrl: mediatek: uninitialized variable in mtk_pctrl_show_one_pin()
@ 2021-11-27 14:07 Dan Carpenter
2021-12-02 1:32 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-11-27 14:07 UTC (permalink / raw)
To: Sean Wang, Zhiyong Tao
Cc: Linus Walleij, Matthias Brugger, Chen-Yu Tsai, linux-mediatek,
linux-gpio, linux-kernel, kernel-janitors, Nathan Chancellor
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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/pinctrl/mediatek/pinctrl-paris.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
index d4e02c5d74a8..4c6f6d967b18 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.c
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
@@ -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;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl: mediatek: uninitialized variable in mtk_pctrl_show_one_pin()
2021-11-27 14:07 [PATCH] pinctrl: mediatek: uninitialized variable in mtk_pctrl_show_one_pin() Dan Carpenter
@ 2021-12-02 1:32 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2021-12-02 1:32 UTC (permalink / raw)
To: Dan Carpenter
Cc: Sean Wang, Zhiyong Tao, Matthias Brugger, Chen-Yu Tsai,
linux-mediatek, linux-gpio, linux-kernel, kernel-janitors,
Nathan Chancellor
On Sat, Nov 27, 2021 at 3:08 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-02 1:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 14:07 [PATCH] pinctrl: mediatek: uninitialized variable in mtk_pctrl_show_one_pin() Dan Carpenter
2021-12-02 1:32 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).