[AX.25]: Use kzalloc
Replace kzalloc instead of kmalloc + memset. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

szülő
2478173464
commit
1b30dd359e
@@ -1382,14 +1382,12 @@ static int __init nr_proto_init(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
dev_nr = kmalloc(nr_ndevs * sizeof(struct net_device *), GFP_KERNEL);
|
||||
dev_nr = kzalloc(nr_ndevs * sizeof(struct net_device *), GFP_KERNEL);
|
||||
if (dev_nr == NULL) {
|
||||
printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device array\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(dev_nr, 0x00, nr_ndevs * sizeof(struct net_device *));
|
||||
|
||||
for (i = 0; i < nr_ndevs; i++) {
|
||||
char name[IFNAMSIZ];
|
||||
struct net_device *dev;
|
||||
|
Reference in New Issue
Block a user