From patchwork Wed May 12 14:48:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 435673 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp5192138jao; Wed, 12 May 2021 14:10:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4B5dtSKzc1tjaVLEqPmZ2YH0sm0Emy9KiTRvrPPGoV1wUgJYz1XwKVKLQkKaKSAyzIx2A X-Received: by 2002:aa7:c903:: with SMTP id b3mr46204028edt.296.1620853834691; Wed, 12 May 2021 14:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620853834; cv=none; d=google.com; s=arc-20160816; b=YJXbYq39gfAHnH/KqIQfgfxPXllrAbYlFyJ7XNK3Xrch7SArar0JVLbNxAqN1VSJme b19cd192g3cnLni+M1FSsMZ4euT7jryCltkKz3jezkmjZV+1tRS+PgNJJYvyusTXONFu nDAly1Z8OH+sunT9TW81KrKDm/1j9y0zNSpsNB7KtWn/nyH3EWcdHFQK5AcMXxEtM+Z1 aWcD2UeFAw0ZIX1GVBRfCBACC1vlMRSFaFEEba6sCQeJ6lt89sU2P2FhoceECXIpcftY ReDEylCwTiPpTn7lAjZPqjeHfODDHecgB4gYZK3h6bin8nG1YysjxOqYBAIZuyxyn91o S+8Q== 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=5Gl6cUvzIlpe+nXfpT5hu4vl4YFkR8EAKqbNHjrJ2vg=; b=OOLe7SnjHa9Ic6tV01q31cXY1//VnqMAMaIB0FukloWrm8BXZrraywWjHG7GkSCquA IflAPoVBOM4fA2VuvUHvp1rXy9oinVgFAL8XnTHaTuEqfTpwsC32oB+FxZek00dogtdy E36Ol6CesJB+/z9UD+ktPHPxZGna+cysbwJTUmaTwlu+FQplUYk27uM+ZJeL/aR96cBS X/xt1sJDuZXm5oUTtgEPq8YsRj4dVh0NV5dcJUTnqU2bbfvf+qz3uwnDXCaXxX9ZSWAC RtBWEUwmm6I/eo4MuUe3sbaLjwQzOpAPOkG8CZ53MZboLesGCP/e4ooDYctFzT9jC5ap seCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xCOwU58d; 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 u19si859013ejx.176.2021.05.12.14.10.34; Wed, 12 May 2021 14:10:34 -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=xCOwU58d; 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 S236825AbhELQ5q (ORCPT + 12 others); Wed, 12 May 2021 12:57:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:33526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244102AbhELQmf (ORCPT ); Wed, 12 May 2021 12:42:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F75661D1D; Wed, 12 May 2021 16:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620835839; bh=AWduXJg6FgG0c+arjJooAVgmGUR5qA93G1hB7ewf7CQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xCOwU58dww34whxnNYi14AsGOYK/bBiNwmGiXXYcg8RE08rzvBdA/5zaEb6ieuG3+ CWPAx0TwUX0NLEyNyOLSNcdP5DeyPcWRyyIQLJJftGhyAdMXA+/zUG4V2fLzDJR21l YBzpSb9fZGawwuwKWsOJ1Gd80EHcrSO4lf4t/h1o= 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 5.12 488/677] net: hns3: Limiting the scope of vector_ring_chain variable Date: Wed, 12 May 2021 16:48:54 +0200 Message-Id: <20210512144853.597154700@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144837.204217980@linuxfoundation.org> References: <20210512144837.204217980@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 bf4302a5cf95..65752f363f43 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -3704,7 +3704,6 @@ static void hns3_nic_set_cpumask(struct hns3_nic_priv *priv) 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; @@ -3736,6 +3735,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;