pinctl: ti: iodelay: fix error checking on pinctrl_count_index_with_args call
authorColin Ian King <colin.king@canonical.com>
Fri, 20 Sep 2019 12:20:30 +0000 (14:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 18:47:06 +0000 (19:47 +0100)
commit7be50e3b1a0085c47eaf0b2928d4930d1288189e
tree55abe98d0429c2cffdfe0a5d2ff372592f97eb3b
parent90391551afd8126afde0784133d77aa27f641a05
pinctl: ti: iodelay: fix error checking on pinctrl_count_index_with_args call

commit 5ff8aca906f3a7a7db79fad92f2a4401107ef50d upstream.

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: 003910ebc83b ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/ti/pinctrl-ti-iodelay.c