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

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
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -2439,11 +2439,12 @@ static int fsl_udc_probe(struct platform_device *pdev)
	/* DEN is bidirectional ep number, max_ep doubles the number */
	/* DEN is bidirectional ep number, max_ep doubles the number */
	udc_controller->max_ep = (dccparams & DCCPARAMS_DEN_MASK) * 2;
	udc_controller->max_ep = (dccparams & DCCPARAMS_DEN_MASK) * 2;


	udc_controller->irq = platform_get_irq(pdev, 0);
	ret = platform_get_irq(pdev, 0);
	if (udc_controller->irq <= 0) {
	if (ret <= 0) {
		ret = udc_controller->irq ? : -ENODEV;
		ret = ret ? : -ENODEV;
		goto err_iounmap;
		goto err_iounmap;
	}
	}
	udc_controller->irq = ret;


	ret = request_irq(udc_controller->irq, fsl_udc_irq, IRQF_SHARED,
	ret = request_irq(udc_controller->irq, fsl_udc_irq, IRQF_SHARED,
			driver_name, udc_controller);
			driver_name, udc_controller);