usb: dwc3: meson-g12a: add IRQ check
authorSergey Shtylyov <s.shtylyov@omp.ru>
Mon, 9 Aug 2021 20:21:14 +0000 (23:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Aug 2021 07:02:31 +0000 (09:02 +0200)
commitbaa2986bda3f7b2386607587a4185e3dff8f98df
tree7bd6d15f3193b40a6651b501a9b3edc8f8869839
parent5324bad66f09fdade4d72f3b8b55caf595557e3d
usb: dwc3: meson-g12a: add IRQ check

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

Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching")
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/96106462-5538-0b2f-f2ab-ee56e4853912@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-meson-g12a.c