net: use kcalloc in netdev_queue alloc
Subsystems (2)
PATCH 1/1 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 <[email protected]>
net/core/dev.c +2 -2
@@ -4198,7 +4198,7 @@ struct net_device *alloc_netdev_mq(int s {struct netdev_queue *tx;struct net_device *dev; -int alloc_size; +size_t alloc_size;void *p;BUG_ON (strlen (name) >=sizeof (dev->name));
@@ -4218,7 +4218,7 @@ struct net_device *alloc_netdev_mq(int sreturn 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" );
David Miller
maintainerFrom: Stephen Hemminger <[email protected]>
Date: Mon, 21 Jul 2008 11:19:33 -0700
Quoted 4 lines
Minor nit, use
size_tfor allocation size and kcalloc to allocate an array. Probably makes no actual code difference.Signed-off-by Stephen Hemminger <[email protected]>
Looks good, applied.
Thanks Stephen.