Skip to content

Commit

Permalink
pinctrl: a minor error checking improvement for pinconf
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dong Aisheng authored and Linus Walleij committed May 15, 2012
1 parent 4851680 commit c95df2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pinctrl/pinconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c95df2d

Please sign in to comment.