[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
parent
2478173464
commit
1b30dd359e
+1
-3
@@ -55,15 +55,13 @@ void ax25_dev_device_up(struct net_device *dev)
|
||||
{
|
||||
ax25_dev *ax25_dev;
|
||||
|
||||
if ((ax25_dev = kmalloc(sizeof(*ax25_dev), GFP_ATOMIC)) == NULL) {
|
||||
if ((ax25_dev = kzalloc(sizeof(*ax25_dev), GFP_ATOMIC)) == NULL) {
|
||||
printk(KERN_ERR "AX.25: ax25_dev_device_up - out of memory\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ax25_unregister_sysctl();
|
||||
|
||||
memset(ax25_dev, 0x00, sizeof(*ax25_dev));
|
||||
|
||||
dev->ax25_ptr = ax25_dev;
|
||||
ax25_dev->dev = dev;
|
||||
dev_hold(dev);
|
||||
|
||||
Reference in New Issue
Block a user