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 A0CC64404F; Wed, 12 Jun 2024 17:04:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D98240E64; Wed, 12 Jun 2024 17:03:30 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id A97DF40E35 for ; Wed, 12 Jun 2024 17:03:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204608; x=1749740608; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tkaOy5wGpYrcDFdbF2lh5YmfJfOmEVUeuBE+KhNob9Q=; b=grHosLf4JGsDyzbztfWglWlQIAFxXYwq2RqH3iBKtE+dpUzKS1QFL/Bk AheyFGo+rRiI27mlMrnIKAevnozOsLOtiVfgFgqkwlIWNR2yq97zQfrJB Jn+/tyYuaECLXv0T/SCKgQl1Ntikma0Zyn+DZpoofTiI9z3U4YWQvPpVg VY5K4Pijopj9e3N2PlUD6aVNF0ebqY67DHIeRKXbEerfVDAEA88Sx2K58 SzML31iEhLTojkDjuO33rkumKBhVKx9VuUsO5iREPkFK7L7i51gXcvd+K 2X8ylwi1O9Y2MgL7vrPj6JClFd/nzPqd/OsQTElqQyAHUPnd31vXxcv/H Q==; X-CSE-ConnectionGUID: OA7XH93LTn+jvJo/PECUGQ== X-CSE-MsgGUID: n9IkC14HQJi15YafM96xSw== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459083" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459083" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:03:24 -0700 X-CSE-ConnectionGUID: bSfLJ/1cR2u1Z+YMp3sAhA== X-CSE-MsgGUID: Zd67/OiaTMi1zAEM4qhHPQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39924819" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:03:23 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Stefan Wegrzyn Subject: [PATCH v2 005/148] net/ice/base: fix for pointer to variable outside scope Date: Wed, 12 Jun 2024 15:59:59 +0100 Message-ID: <2199059774448abd9b3c07619dfd90312ce8d11d.1718204528.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> 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: Ian Stokes 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