diff options
author | Sean Wang <sean.wang@mediatek.com> | 2018-01-09 19:28:24 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-01-11 12:42:12 +0300 |
commit | 181cdac02c51a77f9ae497be624edb99056a0a10 (patch) | |
tree | 11ea6d2fca354713f2d53bbdcbdc41e7c0974df3 /drivers/leds | |
parent | fb36a7b07dbf565014ed624a1bfd24d807f56b85 (diff) | |
download | linux-181cdac02c51a77f9ae497be624edb99056a0a10.tar.xz |
pinctrl: mediatek: mt7622: fix potential uninitialized value being returned
commit d6ed93551320 ("pinctrl: mediatek: add pinctrl driver for MT7622
SoC") leads to the following static checker warning:
drivers/pinctrl/mediatek/pinctrl-mt7622.c:1419 mtk_gpio_get()
error: uninitialized symbol 'value'.
1412 static int mtk_gpio_get(struct gpio_chip *chip, unsigned int gpio)
1413 {
1414 struct mtk_pinctrl *hw = dev_get_drvdata(chip->parent);
1415 int value;
1416
1417 mtk_hw_get_value(hw, gpio, PINCTRL_PIN_REG_DI, &value);
^^^^^^^^^^^^^^^^
1418
1419 return !!value;
1420 }
The appropriate error handling must be added to avoid the potential error
caused by uninitialized value being returned.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/leds')
0 files changed, 0 insertions, 0 deletions