diff options
author | Joe Perches <joe@perches.com> | 2010-08-11 03:02:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-17 20:45:14 -0400 |
commit | baeb2ffab4e67bb9174e6166e070a9a8ec94b0f6 (patch) | |
tree | 08259e966cc0cacc58ed58a4865fe861cc255241 /drivers/net/niu.c | |
parent | 5a68d5ee000bb784c4856391b4861739c8bbd341 (diff) |
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 <joe@perches.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/niu.c')
-rw-r--r-- | drivers/net/niu.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
4504 | 4504 | ||
4505 | np->dev->real_num_tx_queues = np->num_tx_rings; | 4505 | np->dev->real_num_tx_queues = np->num_tx_rings; |
4506 | 4506 | ||
4507 | np->rx_rings = kzalloc(np->num_rx_rings * sizeof(struct rx_ring_info), | 4507 | np->rx_rings = kcalloc(np->num_rx_rings, sizeof(struct rx_ring_info), |
4508 | GFP_KERNEL); | 4508 | GFP_KERNEL); |
4509 | err = -ENOMEM; | 4509 | err = -ENOMEM; |
4510 | if (!np->rx_rings) | 4510 | if (!np->rx_rings) |
@@ -4538,7 +4538,7 @@ static int niu_alloc_channels(struct niu *np) | |||
4538 | return err; | 4538 | return err; |
4539 | } | 4539 | } |
4540 | 4540 | ||
4541 | np->tx_rings = kzalloc(np->num_tx_rings * sizeof(struct tx_ring_info), | 4541 | np->tx_rings = kcalloc(np->num_tx_rings, sizeof(struct tx_ring_info), |
4542 | GFP_KERNEL); | 4542 | GFP_KERNEL); |
4543 | err = -ENOMEM; | 4543 | err = -ENOMEM; |
4544 | if (!np->tx_rings) | 4544 | if (!np->tx_rings) |