projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c65b7d1
)
pinctrl: mediatek: correct error handling
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Sun, 27 Dec 2020 20:18:26 +0000
(21:18 +0100)
committer
Tom Rini
<trini@konsulko.com>
Mon, 18 Jan 2021 20:23:06 +0000
(15:23 -0500)
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>
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
patch
|
blob
|
history
diff --git
a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index
6553dde
..
4dd3f73
100644
(file)
--- 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;