Skip to content

Commit

Permalink
net: remove some unless free on failure in alloc_netdev_mqs()
Browse files Browse the repository at this point in the history
When we jump to free_pcpu on failure in alloc_netdev_mqs()
rx and tx queues are not yet allocated, so no need to free them.

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
WANG Cong authored and David S. Miller committed Jun 4, 2014
1 parent 1b9d48f commit 92ff71b
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -6503,11 +6503,6 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,

free_pcpu:
free_percpu(dev->pcpu_refcnt);
netif_free_tx_queues(dev);
#ifdef CONFIG_SYSFS
kfree(dev->_rx);
#endif

free_dev:
netdev_freemem(dev);
return NULL;
Expand Down

0 comments on commit 92ff71b

Please sign in to comment.