From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CCD8FEA3C5F for ; Thu, 9 Apr 2026 13:00:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7F35E60B38; Thu, 9 Apr 2026 13:00:34 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ENd9HxcDdb2F; Thu, 9 Apr 2026 13:00:33 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 5484961013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1775739633; bh=0eMNwm7bu6O50BJcpukG7TAWSppmOBm5fjMjJvjTytk=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ashDbMNUIOe8LMTla96KssgVJmsYhZfeX8U9lnstph0FOQkZyt4smvNUBql8Y82HQ 4m4/noicCrkuGtTIkZKqev5XtmNqermo6GisISceb/ksQaAzima8VqcN8YNLOIFPzK EbS/GvAc3tjoVaO5pmw+sKkd5s4MSHnx+OBWjQmE56kAe+h9Ib6CDpnUVVtLRDcgDY SkXcbJx3DWuUAygh8cWuG26SAdbVB12cVoc3aHGho18yz3o/VVOvjQP7hnmDv8Ok+/ eDp/tkdzquk/N7g3CaAvZdiUgiAnGngiB96Su2ZJNMIZdwHKKN9zTSs1suSMn263C1 JQzPRxhGnAJmA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 5484961013; Thu, 9 Apr 2026 13:00:33 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists1.osuosl.org (Postfix) with ESMTP id 1F8A61F6 for ; Thu, 9 Apr 2026 13:00:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id F116D400F6 for ; Thu, 9 Apr 2026 13:00:29 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id lbtHUCVIOYEX for ; Thu, 9 Apr 2026 13:00:28 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.19; helo=mgamail.intel.com; envelope-from=marcin.szycik@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 2592840340 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 2592840340 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by smtp2.osuosl.org (Postfix) with ESMTPS id 2592840340 for ; Thu, 9 Apr 2026 13:00:28 +0000 (UTC) X-CSE-ConnectionGUID: o/yxpxOuRlmPKXuadhm/jQ== X-CSE-MsgGUID: OO1sEzirQqyo3OsHU4C9Jw== X-IronPort-AV: E=McAfee;i="6800,10657,11753"; a="75777536" X-IronPort-AV: E=Sophos;i="6.23,169,1770624000"; d="scan'208";a="75777536" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2026 06:00:21 -0700 X-CSE-ConnectionGUID: dMn2HIOoRGGLC69kyQk0pQ== X-CSE-MsgGUID: 7BHlYphpTbqhInD1DSh7oA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,169,1770624000"; d="scan'208";a="259208137" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orviesa002.jf.intel.com with ESMTP; 09 Apr 2026 06:00:19 -0700 Received: from gond.igk.intel.com (gond.igk.intel.com [10.123.220.52]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 1C6B92FC58; Thu, 9 Apr 2026 14:00:18 +0100 (IST) From: Marcin Szycik To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, sandeep.penigalapati@intel.com, ananth.s@intel.com, alexander.duyck@gmail.com, Marcin Szycik , Aleksandr Loktionov , Przemek Kitszel Date: Thu, 9 Apr 2026 14:00:02 +0200 Message-ID: <20260409120003.2719-10-marcin.szycik@linux.intel.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260409120003.2719-1-marcin.szycik@linux.intel.com> References: <20260409120003.2719-1-marcin.szycik@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775739628; x=1807275628; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fw3VWQaw3jKVivPmKcKZkhU6kwzRwU/BAJwJqJQoaQw=; b=UX5MjVvLeMaTmtSBrGeiQl5r4vYYu0TywnRpjiQ2M6QUsVmWQ5gMKRkf MqSJZHfaHfJ/hllmcKi4O8FDkTsDELfvOxedstedAh+q0pbs7/SqtpKE+ JnJKMZDX2c7+qf1FDvfGaoJcAF1QDZag/ZTqcceXs/zvFn2b97aQxjEiY SNNcwKJrVcNCtw75TSnoneFy/B5iiUqmsgKDuIruyGCsqB2/E5GF35jGl S3dRk2MGTNN9IpjM7itqsWZy54K9sxHyv5EHtTLSGNYwIHcohcFKjM1Hd I9t18Ok6qr54JP/9VXuztrcifxOSt+UHE1hiWToQWlxT/UB44a38dSUVZ Q==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=none (p=none dis=none) header.from=linux.intel.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=UX5MjVvL Subject: [Intel-wired-lan] [PATCH iwl-next v2 09/10] ice: re-introduce ice_dealloc_flow_entry() helper X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" It was removed in commit ad667d626825 ("ice: remove null checks before devm_kfree() calls"). Now it's useful again. Signed-off-by: Marcin Szycik Reviewed-by: Aleksandr Loktionov Reviewed-by: Przemek Kitszel --- v2: * Add this patch --- drivers/net/ethernet/intel/ice/ice_flow.c | 33 ++++++++++++++--------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c index 144d8326d4f9..20ee85b0bcf0 100644 --- a/drivers/net/ethernet/intel/ice/ice_flow.c +++ b/drivers/net/ethernet/intel/ice/ice_flow.c @@ -1589,6 +1589,23 @@ ice_flow_find_prof_id(struct ice_hw *hw, enum ice_block blk, u64 prof_id) return NULL; } +/** + * ice_dealloc_flow_entry - Deallocate flow entry memory + * @hw: pointer to the HW struct + * @entry: flow entry to be removed + */ +static void +ice_dealloc_flow_entry(struct ice_hw *hw, struct ice_flow_entry *entry) +{ + if (!entry) + return; + + kfree(entry->entry); + kfree(entry->range_buf); + kfree(entry->acts); + devm_kfree(ice_hw_to_dev(hw), entry); +} + /** * ice_flow_get_hw_prof - return the HW profile for a specific profile ID handle * @hw: pointer to the HW struct @@ -1760,11 +1777,7 @@ static int ice_flow_rem_entry_sync(struct ice_hw *hw, enum ice_block blk, } list_del(&entry->l_entry); - - kfree(entry->entry); - kfree(entry->range_buf); - kfree(entry->acts); - devm_kfree(ice_hw_to_dev(hw), entry); + ice_dealloc_flow_entry(hw, entry); return 0; } @@ -2899,10 +2912,7 @@ static int ice_flow_acl_add_scen_entry_sync(struct ice_hw *hw, /* As we don't add the new entry to our SW DB, deallocate its * memories, and return the exist entry to the caller */ - kfree(e->entry); - kfree(e->range_buf); - kfree(e->acts); - devm_kfree(ice_hw_to_dev(hw), e); + ice_dealloc_flow_entry(hw, e); *entry = exist; } out: @@ -3021,10 +3031,7 @@ int ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id, out: if (status && e) { - kfree(e->entry); - kfree(e->range_buf); - kfree(e->acts); - devm_kfree(ice_hw_to_dev(hw), e); + ice_dealloc_flow_entry(hw, e); } return status; -- 2.49.0