Skip to content

Commit

Permalink
NetCP: Deletion of unnecessary checks before two function calls
Browse files Browse the repository at this point in the history
The functions cpsw_ale_destroy() and of_dev_put() test whether their argument
is NULL and then return immediately. Thus the test around the call
is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Markus Elfring authored and David S. Miller committed Feb 5, 2015
1 parent f339664 commit 9b55669
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/ti/netcp_ethss.c
Original file line number Diff line number Diff line change
Expand Up @@ -2011,12 +2011,10 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
quit:
if (gbe_dev->hw_stats)
devm_kfree(dev, gbe_dev->hw_stats);
if (gbe_dev->ale)
cpsw_ale_destroy(gbe_dev->ale);
cpsw_ale_destroy(gbe_dev->ale);
if (gbe_dev->ss_regs)
devm_iounmap(dev, gbe_dev->ss_regs);
if (interfaces)
of_node_put(interfaces);
of_node_put(interfaces);
devm_kfree(dev, gbe_dev);
return ret;
}
Expand Down

0 comments on commit 9b55669

Please sign in to comment.