浏览代码

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>
Dong Aisheng 13 年之前
父节点
当前提交
c95df2db2c
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/pinctrl/pinconf.c

+ 2 - 2
drivers/pinctrl/pinconf.c

@@ -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;
 	}
 	}