From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0FECEA056A; Wed, 4 Mar 2020 04:04:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 68CEA2C16; Wed, 4 Mar 2020 04:04:38 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id AEE1C1F1C; Wed, 4 Mar 2020 04:04:36 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Mar 2020 19:04:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,511,1574150400"; d="scan'208";a="233967793" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by fmsmga008.fm.intel.com with ESMTP; 03 Mar 2020 19:04:33 -0800 Date: Wed, 4 Mar 2020 11:02:20 +0800 From: Ye Xiaolong To: Qi Zhang Cc: yahui.cao@intel.com, simei.su@intel.com, wei.zhao@intel.com, dev@dpdk.org, stable@dpdk.org Message-ID: <20200304030220.GD99081@intel.com> References: <20200304020549.13304-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200304020549.13304-1-qi.z.zhang@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v3] net/ice: remove unnecessary variable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 03/04, Qi Zhang wrote: >Remove unnecessary variable "meta" in ice_flow_create and >ice_flow_validate, it should be defined when really be needed: >its ice_parse_engine_create and ice_parse_engine_validate. > >A meta data be created by parser->parse_pattern_action should be >freed inside parser->engine->create. > >During a validate operation, since parser->engine_>create will not >be invoked, a meta is not necessary be created during parser, so >NULL will parsed to engine->parse_pattern_action and all parser's >parse_pattern_action need to be modified to handle meta = NULL >properly. > >With above implementation, the patch also fixes a potentional memory s/potentional/potential >leak in ice_parse_engine_validate, since meta may not be freed. > >BTW, an engine without a create op should be regarded as a bug. So >use RTE_ASSERT to replace runtime engine->create == NULL check in >ice_parse_engine_create. > >Fixes: 4e27d3ed02bd ("net/ice: fix flow API framework") >Cc: stable@dpdk.org > >Signed-off-by: Qi Zhang >--- > Reviewed-by: Xiaolong Ye Applied to dpdk-next-net-intel with above fix, Thanks.