Skip to content

Commit 5ff8aca

Browse files
Colin Ian KingLinus Walleij
authored andcommitted
pinctl: ti: iodelay: fix error checking on pinctrl_count_index_with_args call
The call to pinctrl_count_index_with_args checks for a -EINVAL return however this function calls pinctrl_get_list_and_count and this can return -ENOENT. Rather than check for a specific error, fix this by checking for any error return to catch the -ENOENT case. Addresses-Coverity: ("Improper use of negative") Fixes: 003910e ("pinctrl: Introduce TI IOdelay configuration driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20190920122030.14340-1-colin.king@canonical.com Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent ae436fe commit 5ff8aca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/pinctrl/ti/pinctrl-ti-iodelay.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ static int ti_iodelay_dt_node_to_map(struct pinctrl_dev *pctldev,
496496
return -EINVAL;
497497

498498
rows = pinctrl_count_index_with_args(np, name);
499-
if (rows == -EINVAL)
499+
if (rows < 0)
500500
return rows;
501501

502502
*map = devm_kzalloc(iod->dev, sizeof(**map), GFP_KERNEL);

0 commit comments

Comments
 (0)