Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sergey Shtylyov and committed by
Greg Kroah-Hartman
ecff88e8 50855c31

+4
+4
drivers/usb/gadget/udc/s3c2410_udc.c
··· 1784 1784 s3c2410_udc_reinit(udc); 1785 1785 1786 1786 irq_usbd = platform_get_irq(pdev, 0); 1787 + if (irq_usbd < 0) { 1788 + retval = irq_usbd; 1789 + goto err_udc_clk; 1790 + } 1787 1791 1788 1792 /* irq setup after old hardware state is cleaned up */ 1789 1793 retval = request_irq(irq_usbd, s3c2410_udc_irq,