usb: gadget: udc: s3c2410: add IRQ check
authorSergey Shtylyov <s.shtylyov@omp.ru>
Mon, 9 Aug 2021 20:35:11 +0000 (23:35 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:50:39 +0000 (09:50 +0200)
commit99ad1be3e9cb1e9eba0c494c8dbff3b21295b101
tree08640c40aa1cc5ed60c0d65f95199646995efb2e
parent0a77314589685d4a325c6170b237b84867ab4ade
usb: gadget: udc: s3c2410: add IRQ check

[ Upstream commit ecff88e819e31081d41cd05bb199b9bd10e13e90 ]

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

Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources")
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/bd69b22c-b484-5a1f-c798-78d4b78405f2@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/udc/s3c2410_udc.c