Skip to content

Commit

Permalink
fm10k: Unlock mailbox on VLAN addition failures
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthew Vick authored and Jeff Kirsher committed Oct 16, 2014
1 parent 4d41915 commit 13cb2da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,14 +785,14 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
if (!(netdev->flags & IFF_PROMISC)) {
err = hw->mac.ops.update_vlan(hw, vid, 0, set);
if (err)
return err;
goto err_out;
}

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

/* set vid prior to syncing/unsyncing the VLAN */
interface->vid = vid + (set ? VLAN_N_VID : 0);
Expand All @@ -801,9 +801,10 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
__dev_uc_unsync(netdev, fm10k_uc_vlan_unsync);
__dev_mc_unsync(netdev, fm10k_mc_vlan_unsync);

err_out:
fm10k_mbx_unlock(interface);

return 0;
return err;
}

static int fm10k_vlan_rx_add_vid(struct net_device *netdev,
Expand Down

0 comments on commit 13cb2da

Please sign in to comment.