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

usb: phy: fsl-usb: 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: 0807c500a1a6 ("USB: add Freescale USB OTG Transceiver driver")
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/b0a86089-8b8b-122e-fd6d-73e8c2304964@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sergey Shtylyov and committed by
Greg Kroah-Hartman
ecc2f30d 711087f3

+2
+2
drivers/usb/phy/phy-fsl-usb.c
··· 873 873 874 874 /* request irq */ 875 875 p_otg->irq = platform_get_irq(pdev, 0); 876 + if (p_otg->irq < 0) 877 + return p_otg->irq; 876 878 status = request_irq(p_otg->irq, fsl_otg_isr, 877 879 IRQF_SHARED, driver_name, p_otg); 878 880 if (status) {