diff options
author | Matthew Vick <matthew.vick@intel.com> | 2014-10-02 20:43:35 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-10-16 04:55:31 -0400 |
commit | 13cb2dad45cc8c8e350abc84de38449b89629c3c (patch) | |
tree | ae8f78dbb84f1d445cb19ddd82a7d52a7e468e34 | |
parent | 4d4191566fdd0e8990b2e8ab5ae819227c92892f (diff) |
fm10k: Unlock mailbox on VLAN addition failures
After grabbing the mailbox lock and detecting an error, the lock must be
released before the error code can be returned.
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c index bf44a8fe711f..b57ea1c09a21 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | |||
@@ -785,14 +785,14 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set) | |||
785 | if (!(netdev->flags & IFF_PROMISC)) { | 785 | if (!(netdev->flags & IFF_PROMISC)) { |
786 | err = hw->mac.ops.update_vlan(hw, vid, 0, set); | 786 | err = hw->mac.ops.update_vlan(hw, vid, 0, set); |
787 | if (err) | 787 | if (err) |
788 | return err; | 788 | goto err_out; |
789 | } | 789 | } |
790 | 790 | ||
791 | /* update our base MAC address */ | 791 | /* update our base MAC address */ |
792 | err = hw->mac.ops.update_uc_addr(hw, interface->glort, hw->mac.addr, | 792 | err = hw->mac.ops.update_uc_addr(hw, interface->glort, hw->mac.addr, |
793 | vid, set, 0); | 793 | vid, set, 0); |
794 | if (err) | 794 | if (err) |
795 | return err; | 795 | goto err_out; |
796 | 796 | ||
797 | /* set vid prior to syncing/unsyncing the VLAN */ | 797 | /* set vid prior to syncing/unsyncing the VLAN */ |
798 | interface->vid = vid + (set ? VLAN_N_VID : 0); | 798 | interface->vid = vid + (set ? VLAN_N_VID : 0); |
@@ -801,9 +801,10 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set) | |||
801 | __dev_uc_unsync(netdev, fm10k_uc_vlan_unsync); | 801 | __dev_uc_unsync(netdev, fm10k_uc_vlan_unsync); |
802 | __dev_mc_unsync(netdev, fm10k_mc_vlan_unsync); | 802 | __dev_mc_unsync(netdev, fm10k_mc_vlan_unsync); |
803 | 803 | ||
804 | err_out: | ||
804 | fm10k_mbx_unlock(interface); | 805 | fm10k_mbx_unlock(interface); |
805 | 806 | ||
806 | return 0; | 807 | return err; |
807 | } | 808 | } |
808 | 809 | ||
809 | static int fm10k_vlan_rx_add_vid(struct net_device *netdev, | 810 | static int fm10k_vlan_rx_add_vid(struct net_device *netdev, |