]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int
authorColin Ian King <colin.king@canonical.com>
Fri, 15 May 2020 16:54:53 +0000 (17:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 09:11:55 +0000 (11:11 +0200)
commit0ad482ca053285c76bdb960c386398c901ca8e36
tree0202d93111f6f4f96eef4752ba1e9fe9d54bc8de
parent1cec5992cc34aa082541ff10b0ba0356e1e3c045
USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int

[ Upstream commit a7f40c233a6b0540d28743267560df9cfb571ca9 ]

The comparison of hcd->irq to less than zero for an error check will
never be true because hcd->irq is an unsigned int.  Fix this by
assigning the int retval to the return of platform_get_irq and checking
this for the -ve error condition and assigning hcd->irq to retval.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: c856b4b0fdb5 ("USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200515165453.104028-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/ehci-mv.c