]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: actions: fix unsigned less than zero comparison
authorColin Ian King <colin.king@canonical.com>
Mon, 2 Jul 2018 12:47:08 +0000 (13:47 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 2 Jul 2018 14:05:01 +0000 (16:05 +0200)
commitf8ab512e8154fe08e0db5aa8c91248edf904b179
tree9a604c2f387cdf6252eb5fe8276155f295f1d1bd
parent6764a2391f6f7a77b203cea96fc7a1cdfffe41c0
pinctrl: actions: fix unsigned less than zero comparison

The check to see if platform_get_irq failed is performed on the
unsigned value of pctrl->irq[i] and the check is never true because
an unsigned cannot be less than zero.  Fix this by assinging the
signed int ret to the return of platform_get_irq and checking ret
instead.

Detected by CoverityScan, CID#1470247 ("Unsigned comparison against 0")

Fixes: af014dc3fbee ("pinctrl: actions: Add interrupt support for OWL S900 SoC")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/actions/pinctrl-owl.c