From: Andrzej Hajda Date: Mon, 21 Sep 2015 13:33:39 +0000 (+0200) Subject: usb: host: ehci-msm: fix handling platform_get_irq result X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0c43e9d835b003d862a5f76e3affcc1f973fb3c0;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git usb: host: ehci-msm: fix handling platform_get_irq result The function can return negative values. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c index 275c92e53a59..c4f84c81de01 100644 --- a/drivers/usb/host/ehci-msm.c +++ b/drivers/usb/host/ehci-msm.c @@ -80,12 +80,12 @@ static int ehci_msm_probe(struct platform_device *pdev) return -ENOMEM; } - hcd->irq = platform_get_irq(pdev, 0); - if (hcd->irq < 0) { + ret = platform_get_irq(pdev, 0); + if (ret < 0) { dev_err(&pdev->dev, "Unable to get IRQ resource\n"); - ret = hcd->irq; goto put_hcd; } + hcd->irq = ret; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) {