diff options
author | Sergey Shtylyov <s.shtylyov@omp.ru> | 2021-08-09 23:50:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-15 09:47:34 +0200 |
commit | e1473ac28563b0afd5fdf849a6f82b24c48d1467 (patch) | |
tree | 337eedaa57d1814245567fd9b3a98179efbfa6e3 /drivers/usb/phy | |
parent | 9535f55d0cba9313222dac546b76088e1848472a (diff) | |
download | linux-stable-e1473ac28563b0afd5fdf849a6f82b24c48d1467.tar.gz linux-stable-e1473ac28563b0afd5fdf849a6f82b24c48d1467.tar.bz2 linux-stable-e1473ac28563b0afd5fdf849a6f82b24c48d1467.zip |
usb: phy: fsl-usb: add IRQ check
[ Upstream commit ecc2f30dbb25969908115c81ec23650ed982b004 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r-- | drivers/usb/phy/phy-fsl-usb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c index b451f4695f3f..446c7bf67873 100644 --- a/drivers/usb/phy/phy-fsl-usb.c +++ b/drivers/usb/phy/phy-fsl-usb.c @@ -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) { |