diff options
Diffstat (limited to 'net/8021q/vlan.c')
-rw-r--r-- | net/8021q/vlan.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 44ebd5c2cd4a..64c6bed4a3d3 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -250,7 +250,8 @@ static int register_vlan_device(struct net_device *real_dev, u16 vlan_id) | |||
250 | snprintf(name, IFNAMSIZ, "vlan%.4i", vlan_id); | 250 | snprintf(name, IFNAMSIZ, "vlan%.4i", vlan_id); |
251 | } | 251 | } |
252 | 252 | ||
253 | new_dev = alloc_netdev(sizeof(struct vlan_dev_priv), name, vlan_setup); | 253 | new_dev = alloc_netdev(sizeof(struct vlan_dev_priv), name, |
254 | NET_NAME_UNKNOWN, vlan_setup); | ||
254 | 255 | ||
255 | if (new_dev == NULL) | 256 | if (new_dev == NULL) |
256 | return -ENOBUFS; | 257 | return -ENOBUFS; |
@@ -324,23 +325,24 @@ static void vlan_transfer_features(struct net_device *dev, | |||
324 | netdev_update_features(vlandev); | 325 | netdev_update_features(vlandev); |
325 | } | 326 | } |
326 | 327 | ||
327 | static void __vlan_device_event(struct net_device *dev, unsigned long event) | 328 | static int __vlan_device_event(struct net_device *dev, unsigned long event) |
328 | { | 329 | { |
330 | int err = 0; | ||
331 | |||
329 | switch (event) { | 332 | switch (event) { |
330 | case NETDEV_CHANGENAME: | 333 | case NETDEV_CHANGENAME: |
331 | vlan_proc_rem_dev(dev); | 334 | vlan_proc_rem_dev(dev); |
332 | if (vlan_proc_add_dev(dev) < 0) | 335 | err = vlan_proc_add_dev(dev); |
333 | pr_warn("failed to change proc name for %s\n", | ||
334 | dev->name); | ||
335 | break; | 336 | break; |
336 | case NETDEV_REGISTER: | 337 | case NETDEV_REGISTER: |
337 | if (vlan_proc_add_dev(dev) < 0) | 338 | err = vlan_proc_add_dev(dev); |
338 | pr_warn("failed to add proc entry for %s\n", dev->name); | ||
339 | break; | 339 | break; |
340 | case NETDEV_UNREGISTER: | 340 | case NETDEV_UNREGISTER: |
341 | vlan_proc_rem_dev(dev); | 341 | vlan_proc_rem_dev(dev); |
342 | break; | 342 | break; |
343 | } | 343 | } |
344 | |||
345 | return err; | ||
344 | } | 346 | } |
345 | 347 | ||
346 | static int vlan_device_event(struct notifier_block *unused, unsigned long event, | 348 | static int vlan_device_event(struct notifier_block *unused, unsigned long event, |
@@ -355,8 +357,12 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, | |||
355 | bool last = false; | 357 | bool last = false; |
356 | LIST_HEAD(list); | 358 | LIST_HEAD(list); |
357 | 359 | ||
358 | if (is_vlan_dev(dev)) | 360 | if (is_vlan_dev(dev)) { |
359 | __vlan_device_event(dev, event); | 361 | int err = __vlan_device_event(dev, event); |
362 | |||
363 | if (err) | ||
364 | return notifier_from_errno(err); | ||
365 | } | ||
360 | 366 | ||
361 | if ((event == NETDEV_UP) && | 367 | if ((event == NETDEV_UP) && |
362 | (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) { | 368 | (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) { |