ramips: pinctrl: return proper error if pinctrl0 is empty
Children of the pinctrl0 node are optional. Return EINVAL (=missing) instead of 0. Fixes a hang if the pinctrl0 has no children. Signed-off-by: Mathias Kresin <dev@kresin.me> Acked-by: John Crispin <john@phrozen.org>
This commit is contained in:
parent
bf5d32af2a
commit
a3995a6785
1 changed files with 1 additions and 1 deletions
|
@ -193,7 +193,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (!max_maps)
|
+ if (!max_maps)
|
||||||
+ return max_maps;
|
+ return -EINVAL;
|
||||||
+
|
+
|
||||||
+ *map = kzalloc(max_maps * sizeof(struct pinctrl_map), GFP_KERNEL);
|
+ *map = kzalloc(max_maps * sizeof(struct pinctrl_map), GFP_KERNEL);
|
||||||
+ if (!*map)
|
+ if (!*map)
|
||||||
|
|
Loading…
Reference in a new issue