]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: udc: at91: add IRQ check
authorSergey Shtylyov <s.shtylyov@omp.ru>
Mon, 9 Aug 2021 20:27:28 +0000 (23:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:47:34 +0000 (09:47 +0200)
commitfa5c222c3d514aae12dcd501627c95b9238ebc77
treeb5d70d7eba1bdd590d88968b32faaf742d128a8a
parent1e8a449d76c2e9e894b95b5f3780a8f06f9e5588
usb: gadget: udc: at91: add IRQ check

[ Upstream commit 50855c31573b02963f0aa2aacfd4ea41c31ae0e0 ]

The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
error code. Stop calling devm_request_irq() with the invalid IRQ #s.

Fixes: 0f8efc75c1a1 ("USB: AT91 UDC updates, mostly power management")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Felipe Balbi <balbi@kernel.org>
Link: https://lore.kernel.org/r/6654a224-739a-1a80-12f0-76d920f87b6c@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/udc/at91_udc.c