Skip to content

Commit

Permalink
ibmvnic: Fix error recovery on login failure
Browse files Browse the repository at this point in the history
Testing has uncovered a failure case that is not handled properly. In the
event that a login fails and we are not able to recover on the spot, we
return 0 from do_reset, preventing any error recovery code from being
triggered.  Additionally, the state is set to "probed" meaning that when we
are able to trigger the error recovery, the driver always comes up in the
probed state. To handle the case properly, we need to return a failure code
here and set the adapter state to the state that we entered the reset in
indicating the state that we would like to come out of the recovery reset
in.

Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
John Allen authored and David S. Miller committed Jul 16, 2018
1 parent dea39ac commit 3578a7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1827,8 +1827,8 @@ static int do_reset(struct ibmvnic_adapter *adapter,

rc = ibmvnic_login(netdev);
if (rc) {
adapter->state = VNIC_PROBED;
return 0;
adapter->state = reset_state;
return rc;
}

if (adapter->reset_reason == VNIC_RESET_CHANGE_PARAM ||
Expand Down

0 comments on commit 3578a7e

Please sign in to comment.