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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 434220d093aa..3bad1afc89fa 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2698,7 +2698,8 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
2698 /* If command is `set a parameter', or 2698 /* If command is `set a parameter', or
2699 * `get the encoding parameters', check if 2699 * `get the encoding parameters', check if
2700 * the user has the right to do it */ 2700 * the user has the right to do it */
2701 if (IW_IS_SET(cmd) || cmd == SIOCGIWENCODE) { 2701 if (IW_IS_SET(cmd) || cmd == SIOCGIWENCODE
2702 || cmd == SIOCGIWENCODEEXT) {
2702 if (!capable(CAP_NET_ADMIN)) 2703 if (!capable(CAP_NET_ADMIN))
2703 return -EPERM; 2704 return -EPERM;
2704 } 2705 }
@@ -3042,11 +3043,11 @@ void netdev_run_todo(void)
3042 3043
3043 switch(dev->reg_state) { 3044 switch(dev->reg_state) {
3044 case NETREG_REGISTERING: 3045 case NETREG_REGISTERING:
3046 dev->reg_state = NETREG_REGISTERED;
3045 err = netdev_register_sysfs(dev); 3047 err = netdev_register_sysfs(dev);
3046 if (err) 3048 if (err)
3047 printk(KERN_ERR "%s: failed sysfs registration (%d)\n", 3049 printk(KERN_ERR "%s: failed sysfs registration (%d)\n",
3048 dev->name, err); 3050 dev->name, err);
3049 dev->reg_state = NETREG_REGISTERED;
3050 break; 3051 break;
3051 3052
3052 case NETREG_UNREGISTERING: 3053 case NETREG_UNREGISTERING:
@@ -3100,12 +3101,11 @@ struct net_device *alloc_netdev(int sizeof_priv, const char *name,
3100 alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST; 3101 alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST;
3101 alloc_size += sizeof_priv + NETDEV_ALIGN_CONST; 3102 alloc_size += sizeof_priv + NETDEV_ALIGN_CONST;
3102 3103
3103 p = kmalloc(alloc_size, GFP_KERNEL); 3104 p = kzalloc(alloc_size, GFP_KERNEL);
3104 if (!p) { 3105 if (!p) {
3105 printk(KERN_ERR "alloc_dev: Unable to allocate device.\n"); 3106 printk(KERN_ERR "alloc_dev: Unable to allocate device.\n");
3106 return NULL; 3107 return NULL;
3107 } 3108 }
3108 memset(p, 0, alloc_size);
3109 3109
3110 dev = (struct net_device *) 3110 dev = (struct net_device *)
3111 (((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST); 3111 (((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
@@ -3347,7 +3347,7 @@ static int __init net_dev_init(void)
3347 * Initialise the packet receive queues. 3347 * Initialise the packet receive queues.
3348 */ 3348 */
3349 3349
3350 for_each_cpu(i) { 3350 for_each_possible_cpu(i) {
3351 struct softnet_data *queue; 3351 struct softnet_data *queue;
3352 3352
3353 queue = &per_cpu(softnet_data, i); 3353 queue = &per_cpu(softnet_data, i);