]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 27 Nov 2021 14:08:36 +0000 (17:08 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 2 Dec 2021 01:33:33 +0000 (02:33 +0100)
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>
Link: https://lore.kernel.org/r/20211127140836.GB24002@kili
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c

index 91553b2fc1605f1a8db9c3db02f738485db57d45..bd5d7d63e877bb56e1edff67c4a6f5094dabe682 100644 (file)
@@ -811,6 +811,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;