summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-07-22 00:28:44 +0400
committerDavid S. Miller <davem@davemloft.net>2008-07-22 00:28:44 +0400
commit7943986ca1138ac99597b1aa4dc893012dcfdc08 (patch)
treed4e0461f4f0d8c6046253bb72ed12e583e19a5d9 /net
parent847499ce71bdcc8fc542062df6ebed3e596608dd (diff)
downloadlinux-7943986ca1138ac99597b1aa4dc893012dcfdc08.tar.xz
net: use kcalloc in netdev_queue alloc
Minor nit, use size_t for allocation size and kcalloc to allocate an array. Probably makes no actual code difference. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index cbc34c0db376..1698b3998981 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4207,7 +4207,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
{
struct netdev_queue *tx;
struct net_device *dev;
- int alloc_size;
+ size_t alloc_size;
void *p;
BUG_ON(strlen(name) >= sizeof(dev->name));
@@ -4227,7 +4227,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
return NULL;
}
- tx = kzalloc(sizeof(struct netdev_queue) * queue_count, GFP_KERNEL);
+ tx = kcalloc(queue_count, sizeof(struct netdev_queue), GFP_KERNEL);
if (!tx) {
printk(KERN_ERR "alloc_netdev: Unable to allocate "
"tx qdiscs.\n");