All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Singh, Jasvinder" <jasvinder.singh@intel.com>
To: "Yu, DapengX" <dapengx.yu@intel.com>,
	"Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3] net/softnic: fix memory leak in parsing arguments
Date: Wed, 14 Jul 2021 11:07:30 +0000	[thread overview]
Message-ID: <BN9PR11MB5258E39B4285A9D3F5EF7E9FE0139@BN9PR11MB5258.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210714054702.764366-1-dapengx.yu@intel.com>

<snip>

> +	free(firmware);

Memory for firmware is not allocated dynamically, so no need for this.

<snip>

>  struct pmd_params {
> -	const char *name;
> -	const char *firmware;
> +	char name[RTE_DEV_NAME_MAX_LEN];

Please replace " RTE_DEV_NAME_MAX_LEN " with "NAME_SIZE" which is already defined in softnic_internals.h

> +	char firmware[PATH_MAX];

Also, instead of using PATH_MAX, define new macro "SOFTNIC_PATH_MAX   4096" in softnic_internals.h


>  	uint16_t conn_port;
>  	uint32_t cpu_id;
>  	int sc; /**< Service cores. */
> --
> 2.27.0


  reply	other threads:[~2021-07-14 11:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08  8:44 [dpdk-dev] [PATCH] net/softnic: fix memory leak in parsing arguments dapengx.yu
2021-07-13  8:44 ` Andrew Rybchenko
2021-07-13 10:08 ` [dpdk-dev] [PATCH v2] " dapengx.yu
2021-07-13 10:10   ` Andrew Rybchenko
     [not found]     ` <PH0PR11MB512563E3EA51977861DF77CF8C149@PH0PR11MB5125.namprd11.prod.outlook.com>
2021-07-13 10:29       ` Andrew Rybchenko
2021-07-14  5:47   ` [dpdk-dev] [PATCH v3] " dapengx.yu
2021-07-14 11:07     ` Singh, Jasvinder [this message]
2021-07-15  1:42       ` Yu, DapengX
2021-07-15  5:38     ` [dpdk-dev] [PATCH v4] " dapengx.yu
2021-07-16 12:04       ` Singh, Jasvinder
2021-07-23  8:11         ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN9PR11MB5258E39B4285A9D3F5EF7E9FE0139@BN9PR11MB5258.namprd11.prod.outlook.com \
    --to=jasvinder.singh@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dapengx.yu@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.