Skip to content

Commit

Permalink
net-ipvlan: Deletion of an unnecessary check before the function call…
Browse files Browse the repository at this point in the history
… "free_percpu"

The free_percpu() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Acked-by: Mahesh Bandewar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
elfring authored and davem330 committed Dec 6, 2014
1 parent 39af455 commit 04901ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ipvlan/ipvlan_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ static void ipvlan_uninit(struct net_device *dev)
struct ipvl_dev *ipvlan = netdev_priv(dev);
struct ipvl_port *port = ipvlan->port;

if (ipvlan->pcpu_stats)
free_percpu(ipvlan->pcpu_stats);
free_percpu(ipvlan->pcpu_stats);

port->count -= 1;
if (!port->count)
Expand Down

0 comments on commit 04901ce

Please sign in to comment.