From: Dong Aisheng Date: Mon, 14 May 2012 11:06:36 +0000 (+0800) Subject: pinctrl: a minor error checking improvement for pinconf X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c95df2db2cb5a147b42374f391858232517c0576;p=linux-beck.git pinctrl: a minor error checking improvement for pinconf Also checking invalid num_configs when validate the pinconf map. Acked-by: Stephen Warren Signed-off-by: Dong Aisheng Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index 7ce139ef7e64..43f474cdc110 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c @@ -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; }