mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
usb: gadget: udc: at91: add IRQ check
[ Upstream commit 50855c31573b02963f0aa2aacfd4ea41c31ae0e0 ]
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
error code. Stop calling devm_request_irq() with the invalid IRQ #s.
Fixes: 8b2e76687b ("USB: AT91 UDC updates, mostly power management")
Signed-off-by: Sergey Shtylyov <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
05e5b16b79
commit
9535f55d0c
1 changed files with 3 additions and 1 deletions
|
|
@ -1878,7 +1878,9 @@ static int at91udc_probe(struct platform_device *pdev)
|
|||
clk_disable(udc->iclk);
|
||||
|
||||
/* request UDC and maybe VBUS irqs */
|
||||
udc->udp_irq = platform_get_irq(pdev, 0);
|
||||
udc->udp_irq = retval = platform_get_irq(pdev, 0);
|
||||
if (retval < 0)
|
||||
goto err_unprepare_iclk;
|
||||
retval = devm_request_irq(dev, udc->udp_irq, at91_udc_irq, 0,
|
||||
driver_name, udc);
|
||||
if (retval) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue