net: dsa: replace count*size kmalloc by kmalloc_array
kmalloc_array manages count*sizeof overflow. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f35423c137
commit
5bc4b46a70
@ -526,7 +526,8 @@ static int dsa_of_setup_routing_table(struct dsa_platform_data *pd,
|
||||
|
||||
/* First time routing table allocation */
|
||||
if (!cd->rtable) {
|
||||
cd->rtable = kmalloc(pd->nr_chips * sizeof(s8), GFP_KERNEL);
|
||||
cd->rtable = kmalloc_array(pd->nr_chips, sizeof(s8),
|
||||
GFP_KERNEL);
|
||||
if (!cd->rtable)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user