aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 434220d093..83231a27ae 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3042,11 +3042,11 @@ void netdev_run_todo(void)
3042 3042
3043 switch(dev->reg_state) { 3043 switch(dev->reg_state) {
3044 case NETREG_REGISTERING: 3044 case NETREG_REGISTERING:
3045 dev->reg_state = NETREG_REGISTERED;
3045 err = netdev_register_sysfs(dev); 3046 err = netdev_register_sysfs(dev);
3046 if (err) 3047 if (err)
3047 printk(KERN_ERR "%s: failed sysfs registration (%d)\n", 3048 printk(KERN_ERR "%s: failed sysfs registration (%d)\n",
3048 dev->name, err); 3049 dev->name, err);
3049 dev->reg_state = NETREG_REGISTERED;
3050 break; 3050 break;
3051 3051
3052 case NETREG_UNREGISTERING: 3052 case NETREG_UNREGISTERING:
@@ -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);
@@ -3347,7 +3346,7 @@ static int __init net_dev_init(void)
3347 * Initialise the packet receive queues. 3346 * Initialise the packet receive queues.
3348 */ 3347 */
3349 3348
3350 for_each_cpu(i) { 3349 for_each_possible_cpu(i) {
3351 struct softnet_data *queue; 3350 struct softnet_data *queue;
3352 3351
3353 queue = &per_cpu(softnet_data, i); 3352 queue = &per_cpu(softnet_data, i);