summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Shtylyov <s.shtylyov@omp.ru>2021-08-09 23:35:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-13 09:02:37 +0200
commitecff88e819e31081d41cd05bb199b9bd10e13e90 (patch)
treec92638b522b27accb6d34a7c5809e95ae069b36b
parent50855c31573b02963f0aa2aacfd4ea41c31ae0e0 (diff)
downloadlinux-ecff88e819e31081d41cd05bb199b9bd10e13e90.tar.bz2
usb: gadget: udc: s3c2410: add IRQ check
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>
-rw-r--r--drivers/usb/gadget/udc/s3c2410_udc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c
index 179777cb699f..e3931da24277 100644
--- a/drivers/usb/gadget/udc/s3c2410_udc.c
+++ b/drivers/usb/gadget/udc/s3c2410_udc.c
@@ -1784,6 +1784,10 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
s3c2410_udc_reinit(udc);
irq_usbd = platform_get_irq(pdev, 0);
+ if (irq_usbd < 0) {
+ retval = irq_usbd;
+ goto err_udc_clk;
+ }
/* irq setup after old hardware state is cleaned up */
retval = request_irq(irq_usbd, s3c2410_udc_irq,