Commit c95df2db authored by Dong Aisheng's avatar Dong Aisheng Committed by Linus Walleij

pinctrl: a minor error checking improvement for pinconf

Also checking invalid num_configs when validate the pinconf map.
Acked-by: default avatarStephen Warren <swarren@wwwdotorg.org>
Signed-off-by: default avatarDong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 48516804
...@@ -50,9 +50,9 @@ int pinconf_validate_map(struct pinctrl_map const *map, int i) ...@@ -50,9 +50,9 @@ int pinconf_validate_map(struct pinctrl_map const *map, int i)
return -EINVAL; return -EINVAL;
} }
if (map->data.configs.num_configs && if (!map->data.configs.num_configs ||
!map->data.configs.configs) { !map->data.configs.configs) {
pr_err("failed to register map %s (%d): no configs ptr given\n", pr_err("failed to register map %s (%d): no configs given\n",
map->name, i); map->name, i);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment