diff options
-rw-r--r-- | drivers/net/bonding/bond_main.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index f3b01ce4f629..2cc4cfc31892 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -570,10 +570,8 @@ static void bond_add_vlans_on_slave(struct bonding *bond, struct net_device *sla | |||
570 | struct vlan_entry *vlan; | 570 | struct vlan_entry *vlan; |
571 | const struct net_device_ops *slave_ops = slave_dev->netdev_ops; | 571 | const struct net_device_ops *slave_ops = slave_dev->netdev_ops; |
572 | 572 | ||
573 | write_lock_bh(&bond->lock); | ||
574 | |||
575 | if (!bond->vlgrp) | 573 | if (!bond->vlgrp) |
576 | goto out; | 574 | return; |
577 | 575 | ||
578 | if ((slave_dev->features & NETIF_F_HW_VLAN_RX) && | 576 | if ((slave_dev->features & NETIF_F_HW_VLAN_RX) && |
579 | slave_ops->ndo_vlan_rx_register) | 577 | slave_ops->ndo_vlan_rx_register) |
@@ -581,13 +579,10 @@ static void bond_add_vlans_on_slave(struct bonding *bond, struct net_device *sla | |||
581 | 579 | ||
582 | if (!(slave_dev->features & NETIF_F_HW_VLAN_FILTER) || | 580 | if (!(slave_dev->features & NETIF_F_HW_VLAN_FILTER) || |
583 | !(slave_ops->ndo_vlan_rx_add_vid)) | 581 | !(slave_ops->ndo_vlan_rx_add_vid)) |
584 | goto out; | 582 | return; |
585 | 583 | ||
586 | list_for_each_entry(vlan, &bond->vlan_list, vlan_list) | 584 | list_for_each_entry(vlan, &bond->vlan_list, vlan_list) |
587 | slave_ops->ndo_vlan_rx_add_vid(slave_dev, vlan->vlan_id); | 585 | slave_ops->ndo_vlan_rx_add_vid(slave_dev, vlan->vlan_id); |
588 | |||
589 | out: | ||
590 | write_unlock_bh(&bond->lock); | ||
591 | } | 586 | } |
592 | 587 | ||
593 | static void bond_del_vlans_from_slave(struct bonding *bond, | 588 | static void bond_del_vlans_from_slave(struct bonding *bond, |
@@ -597,10 +592,8 @@ static void bond_del_vlans_from_slave(struct bonding *bond, | |||
597 | struct vlan_entry *vlan; | 592 | struct vlan_entry *vlan; |
598 | struct net_device *vlan_dev; | 593 | struct net_device *vlan_dev; |
599 | 594 | ||
600 | write_lock_bh(&bond->lock); | ||
601 | |||
602 | if (!bond->vlgrp) | 595 | if (!bond->vlgrp) |
603 | goto out; | 596 | return; |
604 | 597 | ||
605 | if (!(slave_dev->features & NETIF_F_HW_VLAN_FILTER) || | 598 | if (!(slave_dev->features & NETIF_F_HW_VLAN_FILTER) || |
606 | !(slave_ops->ndo_vlan_rx_kill_vid)) | 599 | !(slave_ops->ndo_vlan_rx_kill_vid)) |
@@ -621,9 +614,6 @@ unreg: | |||
621 | if ((slave_dev->features & NETIF_F_HW_VLAN_RX) && | 614 | if ((slave_dev->features & NETIF_F_HW_VLAN_RX) && |
622 | slave_ops->ndo_vlan_rx_register) | 615 | slave_ops->ndo_vlan_rx_register) |
623 | slave_ops->ndo_vlan_rx_register(slave_dev, NULL); | 616 | slave_ops->ndo_vlan_rx_register(slave_dev, NULL); |
624 | |||
625 | out: | ||
626 | write_unlock_bh(&bond->lock); | ||
627 | } | 617 | } |
628 | 618 | ||
629 | /*------------------------------- Link status -------------------------------*/ | 619 | /*------------------------------- Link status -------------------------------*/ |