diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 434220d093aa..dfb62998866a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -3100,12 +3100,11 @@ struct net_device *alloc_netdev(int sizeof_priv, const char *name, | |||
3100 | alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST; | 3100 | alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST; |
3101 | alloc_size += sizeof_priv + NETDEV_ALIGN_CONST; | 3101 | alloc_size += sizeof_priv + NETDEV_ALIGN_CONST; |
3102 | 3102 | ||
3103 | p = kmalloc(alloc_size, GFP_KERNEL); | 3103 | p = kzalloc(alloc_size, GFP_KERNEL); |
3104 | if (!p) { | 3104 | if (!p) { |
3105 | printk(KERN_ERR "alloc_dev: Unable to allocate device.\n"); | 3105 | printk(KERN_ERR "alloc_dev: Unable to allocate device.\n"); |
3106 | return NULL; | 3106 | return NULL; |
3107 | } | 3107 | } |
3108 | memset(p, 0, alloc_size); | ||
3109 | 3108 | ||
3110 | dev = (struct net_device *) | 3109 | dev = (struct net_device *) |
3111 | (((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST); | 3110 | (((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST); |