Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4172120pxb; Mon, 8 Feb 2021 09:33:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFueuxktLJlKnICssLAG77Fe/3p7ZnZv3+8V0+18vsuo9Od5LFDxPb2aUuDe9UmaJ1DNrv X-Received: by 2002:a17:906:fcb1:: with SMTP id qw17mr18246146ejb.7.1612805619816; Mon, 08 Feb 2021 09:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612805619; cv=none; d=google.com; s=arc-20160816; b=GRwJtqGOaXloOc0dGw8GOC4xWjKqUTtTJprueTY0frbbr/VU6+KPyZHhyjTyaLXHhA hrPGZLBUKVFdjrlyc2f1EWMYsgKteuW7R3k4ebe2pR2P6T8a9OdCBeY1b+2fM/ELRqyG kWwxbsonkCGUuoQZ0cTumUSS/G1C5BW/2SJ99DJAU2tcEP9RvmYSgq4Rka9q43r37bNr XvhL5X3eF6ZHYcMZfZ5Zo6d8bv5m8iZ+cJ5S7ahqVUuQSRsc1hCfFBbmp39uXA1O2mZ7 ELGr4knoj0A8vWInKNpTLXZ1d9ai4tCy38xwx/iPQA42rphSDpHHWrh+w/TTvDsrR9wb r7rw== 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=5hKyh2iRwbIbPG4iwS1642bvAtY4RdDWfsPTk1iKDoc=; b=ZdPMyxU+TL6GyzZk1qHdbD9RmXTQ3IHE9X+kAXFN6ZFI73cZxQgB0yjFAAuLpwsDAq ikauO7aAdov8+5ylm57ZPDYndx8fAjWNn3CCzP/4xKU0iDYhSSyukvtW7aPa0ndBZ0bl LZ2mdcA30G8Dff4rcoa9k4wo7CpNofFNNcI/AVBABNrH6CtVPDfvYPCeB2rR06vmZL3H 3H+gcYIehLnqu/OUB6k8/jgYBSNr6/U2ypNleF+0WNAxv451FTvsApMcDw2HG1Jh/67D 387keqKgeVCTP9U9H1xOASt2uZEg3ven2+/bo17egzZgMUL3273GxjNYhHj8CfWmbLoF GNXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=swzRrMNp; 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 b20si11804193edw.412.2021.02.08.09.33.14; Mon, 08 Feb 2021 09:33:39 -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=swzRrMNp; 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 S234563AbhBHRad (ORCPT + 99 others); Mon, 8 Feb 2021 12:30:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:35490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233765AbhBHPVs (ORCPT ); Mon, 8 Feb 2021 10:21:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3264564F03; Mon, 8 Feb 2021 15:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612797225; bh=57RCI6Z38s/Q0YH42kPR67PV4aWHjxJJRUY8Gs6Iu2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=swzRrMNp5PYstx8Z2hx7vciN+2yq62uLCF3DdQ4wEVtfjI1GsM9aV+J5YEq1dNIYc brmhjhtK4CMPzakJ/DCel4T9Vm2OeIid6lHY97t35gNHKakgAK619U7WPCIV0DPx5e KOWXVwVuy4B7whqEsM4LNofTG+ktyGJrl/1nZ1VQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kevin Lo , Tony Nguyen , Sasha Levin Subject: [PATCH 5.10 036/120] igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr Date: Mon, 8 Feb 2021 16:00:23 +0100 Message-Id: <20210208145819.841261458@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145818.395353822@linuxfoundation.org> References: <20210208145818.395353822@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: Kevin Lo [ Upstream commit ebc8d125062e7dccb7922b2190b097c20d88ad96 ] This patch sets the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr. Without this change it wouldn't lead to a shadow RAM write EEWR timeout. Fixes: ab4056126813 ("igc: Add NVM support") Signed-off-by: Kevin Lo Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igc/igc_i225.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_i225.c b/drivers/net/ethernet/intel/igc/igc_i225.c index 8b67d9b49a83a..7ec04e48860c6 100644 --- a/drivers/net/ethernet/intel/igc/igc_i225.c +++ b/drivers/net/ethernet/intel/igc/igc_i225.c @@ -219,9 +219,9 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words, u16 *data) { struct igc_nvm_info *nvm = &hw->nvm; + s32 ret_val = -IGC_ERR_NVM; u32 attempts = 100000; u32 i, k, eewr = 0; - s32 ret_val = 0; /* A check for invalid values: offset too large, too many words, * too many words for the offset, and not enough words. @@ -229,7 +229,6 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words, if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) || words == 0) { hw_dbg("nvm parameter(s) out of bounds\n"); - ret_val = -IGC_ERR_NVM; goto out; } -- 2.27.0