Skip to content

Commit

Permalink
be2net: release mcc-lock in a failure case in be_cmd_notify_wait()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Suresh Reddy authored and David S. Miller committed Oct 13, 2015
1 parent ae4a9d6 commit 0c88456
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/ethernet/emulex/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit 0c88456

Please sign in to comment.