2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-15 08:44:14 +08:00

pinctrl: a minor error checking improvement for pinconf

Also checking invalid num_configs when validate the pinconf map.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Dong Aisheng 2012-05-14 19:06:36 +08:00 committed by Linus Walleij
parent 4851680491
commit c95df2db2c

View File

@ -50,9 +50,9 @@ int pinconf_validate_map(struct pinctrl_map const *map, int i)
return -EINVAL;
}
if (map->data.configs.num_configs &&
if (!map->data.configs.num_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);
return -EINVAL;
}