Skip to content

Commit

Permalink
pinctrl: mediatek: uninitialized variable in mtk_pctrl_show_one_pin()
Browse files Browse the repository at this point in the history
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: fb34a9a ("pinctrl: mediatek: support rsel feature")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211127140750.GA24002@kili
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Dan Carpenter authored and Linus Walleij committed Dec 2, 2021
1 parent debc8b0 commit 67bbbcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pinctrl/mediatek/pinctrl-paris.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 67bbbcb

Please sign in to comment.