]> git.baikalelectronics.ru Git - kernel.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>
Tue, 19 May 2020 13:11:43 +0000 (15:11 +0200)
commit86880df957fef36a0bc05770ed595372ea88ab50
tree53f2fc20af445700bb2b7e96889bd60845410948
parentdbed6d9b91aa2b053dcf2b58f10e2c58c00e7e9e
USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int

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: 0e0a7767cee7 ("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>
drivers/usb/host/ehci-mv.c