ibmvnic: Fix error recovery on login failure
authorJohn Allen <jallen@linux.ibm.com>
Mon, 16 Jul 2018 15:29:30 +0000 (10:29 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:09:18 +0000 (13:09 +0200)
commit2daadcdc58278f0d57e4ed23e6841e3a0e059ebf
tree7bd504b8c5458e1576fe93a4d75c1334e6537ca2
parenta6c35a5c87509ebaf6cdbc5b035a9184d690b1ba
ibmvnic: Fix error recovery on login failure

[ Upstream commit 3578a7ecb69920efc3885dbd610e98c00dbdf5db ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/ibm/ibmvnic.c