Skip to content

Commit

Permalink
ibmvnic: Set to CLOSED state even on error
Browse files Browse the repository at this point in the history
[ Upstream commit d4083d3 ]

If set_link_state() fails for any reason, we still cleanup the adapter
state and cannot recover from a partial close anyway. So set the adapter
to CLOSED state. That way if a new soft/hard reset is processed, the
adapter will remain in the CLOSED state until the next ibmvnic_open().

Fixes: 01d9bd7 ("ibmvnic: Reorganize device close")
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Reported-by: Abdul Haleem <abdhalee@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
sukadev authored and gregkh committed Mar 4, 2021
1 parent 9de820a commit a1b6925
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/ibm/ibmvnic.c
Expand Up @@ -1254,10 +1254,8 @@ static int __ibmvnic_close(struct net_device *netdev)

adapter->state = VNIC_CLOSING;
rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_DN);
if (rc)
return rc;
adapter->state = VNIC_CLOSED;
return 0;
return rc;
}

static int ibmvnic_close(struct net_device *netdev)
Expand Down

0 comments on commit a1b6925

Please sign in to comment.