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>
This commit is contained in:
committed by
David S. Miller
parent
5a68d5ee00
commit
baeb2ffab4
@@ -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)
|
||||
|
Reference in New Issue
Block a user