summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSergey Shtylyov <s.shtylyov@omp.ru>2021-08-13 23:32:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-22 11:47:54 +0200
commit5e2d2f05204f7ab9c645a1fb9f10a3f6393dd2fa (patch)
treecba5712dbcc50b09cc252bc1eeb316fee2574221 /drivers
parent699b3dbadd41f4078377c583b6ecb4918d60442a (diff)
downloadlinux-stable-5e2d2f05204f7ab9c645a1fb9f10a3f6393dd2fa.tar.gz
linux-stable-5e2d2f05204f7ab9c645a1fb9f10a3f6393dd2fa.tar.bz2
linux-stable-5e2d2f05204f7ab9c645a1fb9f10a3f6393dd2fa.zip
usb: phy: tahvo: add IRQ check
[ Upstream commit 0d45a1373e669880b8beaecc8765f44cb0241e47 ] The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to request_threaded_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling request_threaded_irq() with the invalid IRQ #s. Fixes: 9ba96ae5074c ("usb: omap1: Tahvo USB transceiver driver") Acked-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Link: https://lore.kernel.org/r/8280d6a4-8e9a-7cfe-1aa9-db586dc9afdf@omp.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/phy/phy-tahvo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index 0981abc3d1ad..60d390e28289 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -396,7 +396,9 @@ static int tahvo_usb_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, tu);
- tu->irq = platform_get_irq(pdev, 0);
+ tu->irq = ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
+ return ret;
ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt,
IRQF_ONESHOT,
"tahvo-vbus", tu);