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 13AB9A04DE; Fri, 23 Oct 2020 07:11:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC9C36A68; Fri, 23 Oct 2020 07:11:20 +0200 (CEST) Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by dpdk.org (Postfix) with ESMTP id EC8226A5B for ; Fri, 23 Oct 2020 07:11:17 +0200 (CEST) Received: by mail-oi1-f193.google.com with SMTP id m128so584729oig.7 for ; Thu, 22 Oct 2020 22:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KAiddLcPBbSuMJCk4J2GTgNL0DBCgqpMm2ILEdTHPno=; b=cVLv6D5eUYMzUXu5Rm7/BYMi52GRxOvnbyKagwncFtRODD2W9MSE6z8RtgxIIvIDza hmqdann0VDM4xmlaxE+f9BJUjnmvpkvGxjd5lzMZfDiBG2i6A5ntiaQlxpjIfcVZxjLb sJfgPfCRA6UDgmUORd3b9NoxGGVcToaWO5bPw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KAiddLcPBbSuMJCk4J2GTgNL0DBCgqpMm2ILEdTHPno=; b=ADNa2YQYjVe5iuA9vsafGfzuH5xaFwsEZfufsWpdIA9vYnD14bJy9BbKq3rxzlKOPh 894Kd5pgZVn3ObS46eZ2FjFcqM/LDyOgFQgoAH4QVm5aIObEH9yBhKO3r2vW9ES6Hcoo sddbzF87hSCc5lX7WMw2gV1uQq3vuoG/FIBap2d6DWPsgQ4M7DuDYytB+F+u33Nbb/kv dp/cqBLS9tZsGdgnSgSiVFUuIA63rYVDzdnavVEzA/dxHpJA9t7KF5cVqwNTxC3kwH/o +l/sMAqTqjWuQ0GOTG48o6lD08YtSXPX7Z5qsnqtcwmpxeiGzxLLFaXQGZaUje7mwpSY +NDQ== X-Gm-Message-State: AOAM530698mmdwP/fAEbkVIjBbWUIc//vHKCE8XohgGcqFCtEZx96la/ 8UF6FyCo8I3j0Ero0mAyUw3QnSIZZXY30bmkbqEQkZDOfrtwRg== X-Google-Smtp-Source: ABdhPJyTT1LU2M3WIuv9T9add52atwNfcV6uoBvPC5z3OHcfm11pxUjXnJn/IpjHsZoRPtxfoYodGZNqQtHXI+HtOcU= X-Received: by 2002:aca:918:: with SMTP id 24mr457667oij.179.1603429876228; Thu, 22 Oct 2020 22:11:16 -0700 (PDT) MIME-Version: 1.0 References: <20201021060032.23833-1-ajit.khaparde@broadcom.com> In-Reply-To: From: Ajit Khaparde Date: Thu, 22 Oct 2020 22:11:00 -0700 Message-ID: To: Ferruh Yigit Cc: dpdk-dev , Kalesh AP Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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 Thu, Oct 22, 2020 at 4:47 AM Ferruh Yigit wrote: > > 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? Done. I tried to improvise unnecessarily to avoid changing multiple lines.