diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-12-27 23:18:26 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-18 23:23:06 +0300 |
commit | 97bf73762fed743291bb7e572aa659374990b93d (patch) | |
tree | 718194067045c1846a16935172b7f818e76a87cd /drivers | |
parent | c65b7d1acfffda1a73bcea2cd0d2bc43ce54540f (diff) | |
download | u-boot-97bf73762fed743291bb7e572aa659374990b93d.tar.xz |
pinctrl: mediatek: correct error handling
If no GPIO controller is found, the return value should not depend on a
random value on the stack. Initialize variable ret.
The problem was indicated by cppcheck.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index 6553dde45c..4dd3f73ead 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -615,6 +615,7 @@ static int mtk_gpiochip_register(struct udevice *parent) if (!drv) return -ENOENT; + ret = -ENOENT; dev_for_each_subnode(node, parent) if (ofnode_read_bool(node, "gpio-controller")) { ret = 0; |