Commit ecff88e8 authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Greg Kroah-Hartman
Browse files

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: 188db443 ("usb: gadget: s3c: use platform resources")
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: default avatarFelipe Balbi <balbi@kernel.org>
Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/bd69b22c-b484-5a1f-c798-78d4b78405f2@omp.ru


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 50855c31
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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,