diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2015-02-03 20:12:25 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-04 20:29:47 -0800 |
commit | 9b55669c14212f89dba39a2d8e00c1ec1d44c1ec (patch) | |
tree | c3b1051a8d55dc71b216c608fe1fa9be50bc1326 | |
parent | f339664c0be145b381c788bc0d5c07fbe1dd9d85 (diff) |
NetCP: Deletion of unnecessary checks before two function calls
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>
-rw-r--r-- | drivers/net/ethernet/ti/netcp_ethss.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c index 345cd2563772..84f5ce525750 100644 --- a/drivers/net/ethernet/ti/netcp_ethss.c +++ b/drivers/net/ethernet/ti/netcp_ethss.c @@ -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; } |