Commit 0c43e9d8 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Greg Kroah-Hartman

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/2038576Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8091e0ca
...@@ -80,12 +80,12 @@ static int ehci_msm_probe(struct platform_device *pdev) ...@@ -80,12 +80,12 @@ static int ehci_msm_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
hcd->irq = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (hcd->irq < 0) { if (ret < 0) {
dev_err(&pdev->dev, "Unable to get IRQ resource\n"); dev_err(&pdev->dev, "Unable to get IRQ resource\n");
ret = hcd->irq;
goto put_hcd; goto put_hcd;
} }
hcd->irq = ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) { if (!res) {
......
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