Commit 87a2dfb1 authored by Ye Bin's avatar Ye Bin Committed by Felipe Balbi

usb: gadget: fsl: Fix unsigned expression compared with zero in fsl_udc_probe

udc_controller->irq is "unsigned int" always >= 0, but platform_get_irq may
return little than zero. So "dc_controller->irq < 0" condition is never
accessible.
Acked-by: default avatarLi Yang <leoyang.li@nxp.com>
Signed-off-by: default avatarYe Bin <yebin10@huawei.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent 4eea21dc
......@@ -2439,11 +2439,12 @@ static int fsl_udc_probe(struct platform_device *pdev)
/* DEN is bidirectional ep number, max_ep doubles the number */
udc_controller->max_ep = (dccparams & DCCPARAMS_DEN_MASK) * 2;
udc_controller->irq = platform_get_irq(pdev, 0);
if (udc_controller->irq <= 0) {
ret = udc_controller->irq ? : -ENODEV;
ret = platform_get_irq(pdev, 0);
if (ret <= 0) {
ret = ret ? : -ENODEV;
goto err_iounmap;
}
udc_controller->irq = ret;
ret = request_irq(udc_controller->irq, fsl_udc_irq, IRQF_SHARED,
driver_name, udc_controller);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment