pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel()
Subsystems (5)
PATCH 1/1 pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel()
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 <[email protected]>
--- drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +2 -0
@@ -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 ;
Signature · 7 lines
2.20.1 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
Quoted 8 lines · Dan Carpenter
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:819mtk_pinconf_bias_get_rsel()
error: uninitialized symbol 'pd'.Fixes fb34a9ae383a ("pinctrl: mediatek: support rsel feature")Signed-off-by Dan Carpenter <[email protected]>
Patch applied.
Yours,
Linus Walleij