Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b55669c authored by Markus Elfring's avatar Markus Elfring Committed by David S. Miller
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f339664c
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -2011,11 +2011,9 @@ 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);
	if (gbe_dev->ss_regs)
		devm_iounmap(dev, gbe_dev->ss_regs);
	if (interfaces)
	of_node_put(interfaces);
	devm_kfree(dev, gbe_dev);
	return ret;