From: Mathias Kresin Date: Tue, 25 Jul 2017 18:23:28 +0000 (+0200) Subject: ramips: pinctrl: return proper error if pinctrl0 is empty X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a3995a678551c699c9702ed28003c2ba868d2db1;p=openwrt%2Fstaging%2Fnbd.git 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 Acked-by: John Crispin --- diff --git a/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch b/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch index 6e0d6431f0..dc4585231b 100644 --- a/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch +++ b/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch @@ -193,7 +193,7 @@ Signed-off-by: John Crispin + } + + if (!max_maps) -+ return max_maps; ++ return -EINVAL; + + *map = kzalloc(max_maps * sizeof(struct pinctrl_map), GFP_KERNEL); + if (!*map)