diff options
author | Suresh Reddy <Suresh.Reddy@avagotech.com> | 2015-10-12 10:47:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-13 14:32:42 +0300 |
commit | 0c8845679f3b8f030f3bafcdf226ed92545fa2a9 (patch) | |
tree | 955c3a1fc2896accc9377dc8cc7e117c8bd402b6 /drivers | |
parent | ae4a9d6a6362df4e4e492c297157498d299bdb68 (diff) | |
download | linux-0c8845679f3b8f030f3bafcdf226ed92545fa2a9.tar.xz |
be2net: release mcc-lock in a failure case in be_cmd_notify_wait()
The mcc/mbox lock is not being released when be_cmd_copy() returns
an error.
Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index eb323913cd39..9dc5ce11d996 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c @@ -851,8 +851,10 @@ static int be_cmd_notify_wait(struct be_adapter *adapter, return status; dest_wrb = be_cmd_copy(adapter, wrb); - if (!dest_wrb) - return -EBUSY; + if (!dest_wrb) { + status = -EBUSY; + goto unlock; + } if (use_mcc(adapter)) status = be_mcc_notify_wait(adapter); @@ -862,6 +864,7 @@ static int be_cmd_notify_wait(struct be_adapter *adapter, if (!status) memcpy(wrb, dest_wrb, sizeof(*wrb)); +unlock: be_cmd_unlock(adapter); return status; } |