From baeb2ffab4e67bb9174e6166e070a9a8ec94b0f6 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 11 Aug 2010 07:02:48 +0000 Subject: drivers/net: Convert unbounded kzalloc calls to kcalloc These changes may be slightly safer in some instances. There are other kzalloc calls with a multiply, but those calls are typically "small fixed #" * sizeof(some pointer)" and those are not converted. Signed-off-by: Joe Perches Acked-by: Gertjan van Wingerde Acked-by: Luciano Coelho Signed-off-by: David S. Miller --- drivers/net/niu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/net/niu.c') diff --git a/drivers/net/niu.c b/drivers/net/niu.c index bc695d53cdcc..b4cc61f1fc59 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c @@ -4504,7 +4504,7 @@ static int niu_alloc_channels(struct niu *np) np->dev->real_num_tx_queues = np->num_tx_rings; - np->rx_rings = kzalloc(np->num_rx_rings * sizeof(struct rx_ring_info), + np->rx_rings = kcalloc(np->num_rx_rings, sizeof(struct rx_ring_info), GFP_KERNEL); err = -ENOMEM; if (!np->rx_rings) @@ -4538,7 +4538,7 @@ static int niu_alloc_channels(struct niu *np) return err; } - np->tx_rings = kzalloc(np->num_tx_rings * sizeof(struct tx_ring_info), + np->tx_rings = kcalloc(np->num_tx_rings, sizeof(struct tx_ring_info), GFP_KERNEL); err = -ENOMEM; if (!np->tx_rings) -- cgit v1.2.3