mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[AX.25]: Use kzalloc
Replace kzalloc instead of kmalloc + memset. Signed-off-by: Ralf Baechle <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
2478173464
commit
1b30dd359e
4 changed files with 4 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue