From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 26079454EF; Tue, 25 Jun 2024 13:15:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6335427C3; Tue, 25 Jun 2024 13:15:28 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 9AA78402C4 for ; Tue, 25 Jun 2024 13:15:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314108; x=1750850108; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ifTgOjH9TW76WRlaIMYhGhyWEwAGX1RE7jod9Yjbv2c=; b=aeDUDORr4OMDiFzQGFp08wYOgUMVZ9DDHscLAgypTuAARriF/nmnwSYM cY+xkx7x/mFqZ7bocZENVgUW4+ejy5LCNpgA/cdTm5Wi/ZzpHULeRFBi4 sCOMOxTwCYg1Me7BOZAUuiE08LUw1pgoUFHkLO5nw7P1xbfXe/L1JpBnK QpRhQCs/rGduFUtHeGzQc3TSzVLPaJEXc+cZXS9NqctVnR7GMgXRvbfvd riPJsRPTihqRwezj6AvUP/s2dAyh49iF3cQQ8lIfyLElJbq9r/iMlWCI+ K6VU/xB4enaaECcT64xvgnX1jzvpI8oGxmABAryN1n8Ldo88Y4RMN4KMz g==; X-CSE-ConnectionGUID: +DBrwqkgQpGdRaVwAOJD3w== X-CSE-MsgGUID: yBy1uZ9RRWu2Rr4Dr45beA== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080067" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080067" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:15:08 -0700 X-CSE-ConnectionGUID: aPmmG3RgQLC8KsE9UzePJQ== X-CSE-MsgGUID: yW7VeXQ3R2O0RvCDffrGLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43718863" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:15:07 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Stefan Wegrzyn , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 005/129] net/ice/base: fix for pointer to variable outside scope Date: Tue, 25 Jun 2024 12:12:10 +0100 Message-ID: <7a67602bee5d6862e11a939d511a3cb24ba59e84.1719313663.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Stefan Wegrzyn Currently, the 'temp' variable is in the same scope as 'first_teid_ptr' and we take point to it, which means on new loop iterations the memory goes out of scope and we keep a dangling pointer. Move 'temp' to outside of the loop to fix it. Signed-off-by: Stefan Wegrzyn Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index d694bfd414..c9d70fb043 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -1069,11 +1069,11 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi, u32 *first_teid_ptr = first_node_teid; u16 new_num_nodes = num_nodes; int status = 0; + u32 temp; *num_nodes_added = 0; while (*num_nodes_added < num_nodes) { u16 max_child_nodes, num_added = 0; - u32 temp; status = ice_sched_add_nodes_to_hw_layer(pi, tc_node, parent, layer, new_num_nodes, -- 2.43.0