ramips: pinctrl: return proper error if pinctrl0 is empty
authorMathias Kresin <dev@kresin.me>
Tue, 25 Jul 2017 18:23:28 +0000 (20:23 +0200)
committerMathias Kresin <dev@kresin.me>
Thu, 27 Jul 2017 07:12:15 +0000 (09:12 +0200)
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>
target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch

index 6e0d6431f03962842914eecb7b9d94ce38eec4a7..dc4585231b8b0d8d98e7cac514058e4b5eea4d34 100644 (file)
@@ -193,7 +193,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +      }
 +
 +      if (!max_maps)
-+              return max_maps;
++              return -EINVAL;
 +
 +      *map = kzalloc(max_maps * sizeof(struct pinctrl_map), GFP_KERNEL);
 +      if (!*map)