usb: phy: twl6030: add IRQ checks
authorSergey Shtylyov <s.shtylyov@omp.ru>
Mon, 9 Aug 2021 20:53:16 +0000 (23:53 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:50:39 +0000 (09:50 +0200)
commiteabbb2e8cc41a4c1149ea6ec2e3c51572301accb
tree47883c44b307f9beb78b8f66e6fad2f2e8d7e219
parentfa5dbfd53982fd98d1ccc234a9595d8e0489eff5
usb: phy: twl6030: add IRQ checks

[ Upstream commit 0881e22c06e66af0b64773c91c8868ead3d01aa1 ]

The driver neglects to check the result of platform_get_irq()'s calls and
blithely passes the negative error codes to request_threaded_irq() (which
takes *unsigned* IRQ #), causing them both to fail with -EINVAL, overriding
an original error code.  Stop calling request_threaded_irq() with the
invalid IRQ #s.

Fixes: c33fad0c3748 ("usb: otg: Adding twl6030-usb transceiver driver for OMAP4430")
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/9507f50b-50f1-6dc4-f57c-3ed4e53a1c25@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/phy/phy-twl6030-usb.c