Commit 3df9fcd5 authored by Himangi Saraogi's avatar Himangi Saraogi Committed by Greg Kroah-Hartman
Browse files

phy: omap-usb2: fix devm_ioremap_resource error detection code

devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.

A simplified version of the semantic match that finds this problem is as

// <smpl>
expression e,e1;
statement S;

*e = devm_ioremap_resource(...);
if (!e1) S

// </smpl>
Signed-off-by: default avatarHimangi Saraogi <>
Acked-by: default avatarJulia Lawall <>
Signed-off-by: default avatarKishon Vijay Abraham I <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 9820ccba
......@@ -233,8 +233,8 @@ static int omap_usb2_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
phy->phy_base = devm_ioremap_resource(&pdev->dev, res);
if (!phy->phy_base)
return -ENOMEM;
if (IS_ERR(phy->phy_base))
return PTR_ERR(phy->phy_base);
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