Skip to content

Commit

Permalink
[NET] kzalloc: use in alloc_netdev
Browse files Browse the repository at this point in the history
Noticed this use, fixed it.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and David S. Miller committed Apr 10, 2006
1 parent 83b950c commit 31380de
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3100,12 +3100,11 @@ struct net_device *alloc_netdev(int sizeof_priv, const char *name,
alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST;
alloc_size += sizeof_priv + NETDEV_ALIGN_CONST;

p = kmalloc(alloc_size, GFP_KERNEL);
p = kzalloc(alloc_size, GFP_KERNEL);
if (!p) {
printk(KERN_ERR "alloc_dev: Unable to allocate device.\n");
return NULL;
}
memset(p, 0, alloc_size);

dev = (struct net_device *)
(((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
Expand Down

0 comments on commit 31380de

Please sign in to comment.