Skip to content

Commit

Permalink
usb: phy: tahvo: add IRQ check
Browse files Browse the repository at this point in the history
[ Upstream commit 0d45a13 ]

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: 9ba96ae ("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>
  • Loading branch information
Sergey Shtylyov authored and gregkh committed Sep 15, 2021
1 parent 46638d6 commit 494629b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/phy/phy-tahvo.c
Expand Up @@ -393,7 +393,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);
Expand Down

0 comments on commit 494629b

Please sign in to comment.