Skip to content

Commit

Permalink
net: stmmac: fix return value check in socfpga_dwmac_parse_data()
Browse files Browse the repository at this point in the history
In case of error, the function devm_ioremap_resource() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Sep 13, 2014
1 parent 3ce62a8 commit f19f916
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
}

dwmac->splitter_base = devm_ioremap_resource(dev, &res_splitter);
if (!dwmac->splitter_base) {
if (IS_ERR(dwmac->splitter_base)) {
dev_info(dev, "Failed to mapping emac splitter\n");
return -EINVAL;
return PTR_ERR(dwmac->splitter_base);
}
}

Expand Down

0 comments on commit f19f916

Please sign in to comment.