Skip to content

Commit 13cb2da

Browse files
MatthewVickIntelJeff Kirsher
authored andcommitted
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>
1 parent 4d41915 commit 13cb2da

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎drivers/net/ethernet/intel/fm10k/fm10k_netdev.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,14 +785,14 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
785785
if (!(netdev->flags & IFF_PROMISC)) {
786786
err = hw->mac.ops.update_vlan(hw, vid, 0, set);
787787
if (err)
788-
return err;
788+
goto err_out;
789789
}
790790

791791
/* update our base MAC address */
792792
err = hw->mac.ops.update_uc_addr(hw, interface->glort, hw->mac.addr,
793793
vid, set, 0);
794794
if (err)
795-
return err;
795+
goto err_out;
796796

797797
/* set vid prior to syncing/unsyncing the VLAN */
798798
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)
801801
__dev_uc_unsync(netdev, fm10k_uc_vlan_unsync);
802802
__dev_mc_unsync(netdev, fm10k_mc_vlan_unsync);
803803

804+
err_out:
804805
fm10k_mbx_unlock(interface);
805806

806-
return 0;
807+
return err;
807808
}
808809

809810
static int fm10k_vlan_rx_add_vid(struct net_device *netdev,

0 commit comments

Comments
 (0)