From patchwork Thu May 20 09:20:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 443195 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp2137492jac; Thu, 20 May 2021 03:04:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4oUqa71T8HlM4qVJ60AeV8C6fZYQRdjshwlpQ1CGMDBf8uM7Vg/OMFXZTh5Wa881z8DTN X-Received: by 2002:a6b:f80e:: with SMTP id o14mr337191ioh.176.1621505067105; Thu, 20 May 2021 03:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621505067; cv=none; d=google.com; s=arc-20160816; b=mZYLPeCKcb/niRv/hGWoejy59b5HM3pNmabjPsMmZvEee/QHwoQdELKWklkfj5Odih q0BZ8D7iqIoeYY3FFqFuyfFIdpikv/AN6RYfjw6YmRUnBOp+CBj0cPTePgQyX2/mNiIv 7ykAqHdu55voGtY0IebUkW72AWXjHl20ms5AfNlPx4G/VxM48x9+JeixgHmc87KRe+fe eN04x7rfhcBbRTYTe7DgHS8EFNnVT2otVTwit4L5rBYkOT2Hlqi5OngD2BXE4I+UAvAP /7GJvJCq1LrISLuWZOY7M+v+Alr0Cz6XUJDQGbJI7m9G+MLXVUMy1VfCPZ/CduazDk6K ingA== 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=SEuDIXm5bx1U9/fQ7LtNswr5NkmtY8f+PBDU50AGsmI=; b=Eg+wkW7CvjmapWPB00NIjSJkd3coTVZZnPEWVA+1El9bcDFd5fEpTpBigi9LuZccxK ctnKjnDtgdz8ue5OkVgxMXswuzprxJfqQvk6KTVffW0re7+K5yO1zbeTARElATYSqIdb 13tLeDJOTEeHDhbW02rPAAEUbMq0KNTRbRq/V3jdq3KDGobo6u7oVxKAn5IfWtkKyugz 5za2AcoVE+61wQZ1VRqlI9FiSie7YIaeGWH9b2CtunJycN57oM5lZao3XEaQrI8mo1Gp Utu3x96moi2cx+d/7J7nF2bHR2tE5rzhe0ySriDoTsDv3TNx8aQ2/uPgpv+8tPI6Fm48 9zqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bcy+l2ag; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 h10si2694120ili.90.2021.05.20.03.04.26; Thu, 20 May 2021 03:04:27 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=bcy+l2ag; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S234404AbhETKFn (ORCPT + 12 others); Thu, 20 May 2021 06:05:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:37770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234648AbhETKCZ (ORCPT ); Thu, 20 May 2021 06:02:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 30BE56191B; Thu, 20 May 2021 09:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503590; bh=Z/7fkRUSnsbC0u1LZ+b9iDIGpfTrWbn6J1qhb62N6YI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bcy+l2ag4POKUOr0cs2wG+Ka1nTNUZ15kBc07l71V95rsmDba53ScVGlgo6UVVMvz rlXOKsPi0SGdfW+K642Td3WccNAD6WbuOtP9pntYV3cAmOTIdc3ITXt27fU90C0KQO s6N6yATRcvx8bPVxpLn5bOJbHx0OYRShmsUwhJG0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Salil Mehta , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 256/425] net: hns3: Limiting the scope of vector_ring_chain variable Date: Thu, 20 May 2021 11:20:25 +0200 Message-Id: <20210520092139.845823756@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Salil Mehta [ Upstream commit d392ecd1bc29ae15b0e284d5f732c2d36f244271 ] Limiting the scope of the variable vector_ring_chain to the block where it is used. Fixes: 424eb834a9be ("net: hns3: Unified HNS3 {VF|PF} Ethernet Driver for hip08 SoC") Signed-off-by: Salil Mehta Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 3eb8b85f6afb..3b89673f09da 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -2639,7 +2639,6 @@ static void hns3_add_ring_to_group(struct hns3_enet_ring_group *group, static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv) { - struct hnae3_ring_chain_node vector_ring_chain; struct hnae3_handle *h = priv->ae_handle; struct hns3_enet_tqp_vector *tqp_vector; int ret = 0; @@ -2669,6 +2668,8 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv) } for (i = 0; i < priv->vector_num; i++) { + struct hnae3_ring_chain_node vector_ring_chain; + tqp_vector = &priv->tqp_vector[i]; tqp_vector->rx_group.total_bytes = 0;