Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3635336pxb; Mon, 1 Mar 2021 15:47:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFClklhEAT/tDzkOYEw54u150WVexpEQM2NWvCjISHASUhJs+ylj4M+R0jwFdGDMXC2z5F X-Received: by 2002:a17:906:684b:: with SMTP id a11mr9641034ejs.329.1614642463112; Mon, 01 Mar 2021 15:47:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614642463; cv=none; d=google.com; s=arc-20160816; b=HwEMcZxvUOGK/6MxKfR4S7SmGmGrWkxuC9pfYMxyXtlDYd9WLakU7zHUXkaRDHgj4G rVN1HHJJ2/1giKaYWqDHgCBO00oIkR1JH6CivenBxmfT0M1vAtNBO0S9IpEU1qsaitT6 j6nmDS8MPddxulkVs3oPmPUnxsAO+8kRe7OAXsU2OsP62ubWHeymdf+EX0R24yI99Dlz xTfJI6EyLxUpZ/GnZC/J8+6nobUvjdvoB/8IknNJAfHMtCGzcECcXpKNXHuMwYxtvpxO tej9bPfrgEXof/zH5wzA1X9EIssEo/dycoxRepBsZBBncSpNI+tgFhx8TaxGEWKrhRdK J/pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XPlrt+mBXEkzl0K9Hra8jxku/fIXrs2d+l72vFmXRJg=; b=i4pbBTEzaSLTSbhqKt9mTwZu/vESl5O8/MDiWki6lm3ki60aWfpVzwQfpOjlWPAAGP wu1tx9totQlO/jPfu8/CtOsZk/hzkz13POqC7J9Ji1OX1s3FP/IyRXOjbt/XoMM0jfAR zbFXzcb4zocP/lPdYxMfeWfYLz9lGEt4ecsQmxfv1H9EdmLR+1QyAsZzoRseA02kxNaS aE/cLcjNoyeEC2wGVIc+iZRpbWJfp5arG6ZeSkCEa1IP25CV20B9N0a3kN8Mdjb6nkG2 GjdTlHr33WnXHRv3eLN/cctvntdshVsegiZV+9Fnpkzld9x7Ygtwz/RpRvvvrapAU8az /AsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kYmicHyS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu8si11861799edb.349.2021.03.01.15.47.21; Mon, 01 Mar 2021 15:47:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kYmicHyS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343761AbhCAXYk (ORCPT + 99 others); Mon, 1 Mar 2021 18:24:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:54152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238125AbhCASBa (ORCPT ); Mon, 1 Mar 2021 13:01:30 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F66D64E6B; Mon, 1 Mar 2021 16:38:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616701; bh=k2d6AosMwifMRnf+jddaycRdCGqS5bevV4V+je0CmgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kYmicHySxfHtm93XbB/PRaq5znNrI7FXSF5H8Ag9ZiR//RHKeROSyHROnLsZCwIYs KLrKMg43mTs+EfcQLbJRqHBnRTlm3RKqjGqmW6YMQ4xssrDChHl7/bqtfkmMg8QUcz QNHbicRFHKb5AU25GTEqVa6Lt6yjaG8mEvF+lnq4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sukadev Bhattiprolu , Abdul Haleem , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 058/247] ibmvnic: Set to CLOSED state even on error Date: Mon, 1 Mar 2021 17:11:18 +0100 Message-Id: <20210301161034.502819013@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sukadev Bhattiprolu [ Upstream commit d4083d3c00f60a09ad82e3bf17ff57fec69c8aa6 ] 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: 01d9bd792d16 ("ibmvnic: Reorganize device close") Signed-off-by: Sukadev Bhattiprolu Reported-by: Abdul Haleem Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ibmvnic.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 68d5971c200a1..5518b56c2a967 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -1257,10 +1257,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) -- 2.27.0