summaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorTom Herbert2010-11-09 11:47:30 +0100
committerDavid S. Miller2010-11-15 19:56:54 +0100
commited9af2e839c06c18f721da2c768fbb444c4a10e5 (patch)
tree446f54e1f2d6951a7803f34f8ca0e4c0b9375f1b /net/core/dev.c
parentxfrm: use gre key as flow upper protocol info (diff)
downloadkernel-qcow2-linux-ed9af2e839c06c18f721da2c768fbb444c4a10e5.tar.gz
kernel-qcow2-linux-ed9af2e839c06c18f721da2c768fbb444c4a10e5.tar.xz
kernel-qcow2-linux-ed9af2e839c06c18f721da2c768fbb444c4a10e5.zip
net: Move TX queue allocation to alloc_netdev_mq
TX queues are now allocated in alloc_netdev_mq and freed in free_netdev. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 8b500c3e0297..75490670e0a9 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5136,10 +5136,6 @@ int register_netdevice(struct net_device *dev)
if (ret)
goto out;
- ret = netif_alloc_netdev_queues(dev);
- if (ret)
- goto out;
-
netdev_init_queues(dev);
/* Init, if this function is available */
@@ -5599,6 +5595,8 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
dev->num_tx_queues = queue_count;
dev->real_num_tx_queues = queue_count;
+ if (netif_alloc_netdev_queues(dev))
+ goto free_pcpu;
#ifdef CONFIG_RPS
dev->num_rx_queues = queue_count;
@@ -5619,6 +5617,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
free_pcpu:
free_percpu(dev->pcpu_refcnt);
+ kfree(dev->_tx);
free_p:
kfree(p);
return NULL;