From: Sukadev Bhattiprolu Date: Wed, 8 Sep 2021 05:07:03 +0000 (-0700) Subject: ibmvnic: check failover_pending in login response X-Git-Tag: accepted/tizen/unified/20230118.172025~6349^2~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d437f5aa23aa2b7bd07cd44b839d7546cc17166f;p=platform%2Fkernel%2Flinux-rpi.git ibmvnic: check failover_pending in login response If a failover occurs before a login response is received, the login response buffer maybe undefined. Check that there was no failover before accessing the login response buffer. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index a775c69..6aa6ff8 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4700,6 +4700,14 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq, return 0; } + if (adapter->failover_pending) { + adapter->init_done_rc = -EAGAIN; + netdev_dbg(netdev, "Failover pending, ignoring login response\n"); + complete(&adapter->init_done); + /* login response buffer will be released on reset */ + return 0; + } + netdev->mtu = adapter->req_mtu - ETH_HLEN; netdev_dbg(adapter->netdev, "Login Response Buffer:\n");