* [PATCH] pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel()
@ 2021-11-27 14:08 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-11-27 14:08 UTC (permalink / raw)
To: Sean Wang, Zhiyong Tao
Cc: Linus Walleij, Matthias Brugger, Chen-Yu Tsai, linux-mediatek,
linux-gpio, kernel-janitors
All the other mtk_hw_get_value() calls have a check for "if (err)" so
we can add one here as well. This silences a Smatch warning:
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:819 mtk_pinconf_bias_get_rsel()
error: uninitialized symbol 'pd'.
Fixes: fb34a9ae383a ("pinctrl: mediatek: support rsel feature")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
index 53779822348d..e1ae3beb9f72 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
@@ -815,6 +815,8 @@ static int mtk_pinconf_bias_get_rsel(struct mtk_pinctrl *hw,
goto out;
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd);
+ if (err)
+ goto out;
if (pu == 0 && pd == 0) {
*pullup = 0;
--
2.20.1
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel()
@ 2021-11-27 14:08 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-11-27 14:08 UTC (permalink / raw)
To: Sean Wang, Zhiyong Tao
Cc: Linus Walleij, Matthias Brugger, Chen-Yu Tsai, linux-mediatek,
linux-gpio, kernel-janitors
All the other mtk_hw_get_value() calls have a check for "if (err)" so
we can add one here as well. This silences a Smatch warning:
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:819 mtk_pinconf_bias_get_rsel()
error: uninitialized symbol 'pd'.
Fixes: fb34a9ae383a ("pinctrl: mediatek: support rsel feature")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
index 53779822348d..e1ae3beb9f72 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
@@ -815,6 +815,8 @@ static int mtk_pinconf_bias_get_rsel(struct mtk_pinctrl *hw,
goto out;
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd);
+ if (err)
+ goto out;
if (pu == 0 && pd == 0) {
*pullup = 0;
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel()
2021-11-27 14:08 ` Dan Carpenter
@ 2021-12-02 1:33 ` Linus Walleij
-1 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2021-12-02 1:33 UTC (permalink / raw)
To: Dan Carpenter
Cc: Sean Wang, Zhiyong Tao, Matthias Brugger, Chen-Yu Tsai,
linux-mediatek, linux-gpio, kernel-janitors
On Sat, Nov 27, 2021 at 3:09 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> All the other mtk_hw_get_value() calls have a check for "if (err)" so
> we can add one here as well. This silences a Smatch warning:
>
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:819 mtk_pinconf_bias_get_rsel()
> error: uninitialized symbol 'pd'.
>
> 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] 4+ messages in thread
* Re: [PATCH] pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel()
@ 2021-12-02 1:33 ` Linus Walleij
0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2021-12-02 1:33 UTC (permalink / raw)
To: Dan Carpenter
Cc: Sean Wang, Zhiyong Tao, Matthias Brugger, Chen-Yu Tsai,
linux-mediatek, linux-gpio, kernel-janitors
On Sat, Nov 27, 2021 at 3:09 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> All the other mtk_hw_get_value() calls have a check for "if (err)" so
> we can add one here as well. This silences a Smatch warning:
>
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:819 mtk_pinconf_bias_get_rsel()
> error: uninitialized symbol 'pd'.
>
> Fixes: fb34a9ae383a ("pinctrl: mediatek: support rsel feature")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Patch applied.
Yours,
Linus Walleij
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-12-02 1:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 14:08 [PATCH] pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel() Dan Carpenter
2021-11-27 14:08 ` Dan Carpenter
2021-12-02 1:33 ` Linus Walleij
2021-12-02 1:33 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.