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 29E7EA04DD; Thu, 22 Oct 2020 13:47:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BC8AAA9C2; Thu, 22 Oct 2020 13:47:21 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 197ACA955 for ; Thu, 22 Oct 2020 13:47:18 +0200 (CEST) IronPort-SDR: ayl+unkrAR6VnlNOSVp/98s/ctodhtv2BY91Jpf+qTbAsqcR9haPkhc9LgkD0blDV6vPr0o7dd fPK/PbTCPz0g== X-IronPort-AV: E=McAfee;i="6000,8403,9781"; a="155298318" X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="155298318" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 04:47:18 -0700 IronPort-SDR: 318Y/4KAZjd9F2poIM4nYRgRkH8rciRHxnxD7ncoK/PCEpPivHuaySNNmafBe/xUVGujQy/BiF LsKJ8fu8fbFg== X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="533935231" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.248.224]) ([10.213.248.224]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 04:47:17 -0700 To: Ajit Khaparde , dev@dpdk.org Cc: Kalesh AP References: <20201021060032.23833-1-ajit.khaparde@broadcom.com> From: Ferruh Yigit Message-ID: Date: Thu, 22 Oct 2020 12:47:15 +0100 MIME-Version: 1.0 In-Reply-To: <20201021060032.23833-1-ajit.khaparde@broadcom.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] net/bnxt: fix a potential resource leak 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 10/21/2020 7:00 AM, Ajit Khaparde wrote: > Fix a potential resource leak in case of errors during dev args > parsing during device probe. > > Fixes: 6dc83230b43b ("net/bnxt: support port representor data path") > > Signed-off-by: Ajit Khaparde > Reviewed-by: Kalesh AP > --- > drivers/net/bnxt/bnxt_ethdev.c | 35 +++++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c > index 562cf14ba..aa2d9e00e 100644 > --- a/drivers/net/bnxt/bnxt_ethdev.c > +++ b/drivers/net/bnxt/bnxt_ethdev.c > @@ -6285,7 +6285,7 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev, > struct bnxt *backing_bp; > uint16_t num_rep; > int i, ret = 0; > - struct rte_kvargs *kvlist; > + struct rte_kvargs *kvlist = NULL; > > num_rep = eth_da.nb_representor_ports; > if (num_rep > BNXT_MAX_VF_REPS) { > @@ -6339,49 +6339,79 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev, > * Invoked as for ex: "-w 000:00:0d.0, > * rep-based-pf= rep-is-pf=" > */ > + ret = > rte_kvargs_process(kvlist, BNXT_DEVARG_REP_IS_PF, > bnxt_parse_devarg_rep_is_pf, > (void *)&representor); Hi Ajit, This is a different syntax, seems repeated a few times below, is it auto generated? Can it be possible to merge the assignment line with the call?