Skip to content

Commit

Permalink
usb: phy: fsl-usb: add IRQ check
Browse files Browse the repository at this point in the history
[ Upstream commit ecc2f30 ]

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: 0807c50 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Sergey Shtylyov authored and gregkh committed Sep 15, 2021
1 parent 99ad1be commit fa5dbfd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/phy/phy-fsl-usb.c
Expand Up @@ -873,6 +873,8 @@ int usb_otg_start(struct platform_device *pdev)

/* request irq */
p_otg->irq = platform_get_irq(pdev, 0);
if (p_otg->irq < 0)
return p_otg->irq;
status = request_irq(p_otg->irq, fsl_otg_isr,
IRQF_SHARED, driver_name, p_otg);
if (status) {
Expand Down

0 comments on commit fa5dbfd

Please sign in to comment.