patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: dapengx.yu@intel.com, Jasvinder Singh <jasvinder.singh@intel.com>,
	Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/softnic: fix memory leak in connection init
Date: Tue, 13 Jul 2021 12:37:34 +0300	[thread overview]
Message-ID: <034efec5-86f3-82c3-ff51-822b5fd1dd52@oktetlabs.ru> (raw)
In-Reply-To: <20210709060056.957949-1-dapengx.yu@intel.com>

On 7/9/21 9:00 AM, dapengx.yu@intel.com wrote:
> From: Dapeng Yu <dapengx.yu@intel.com>
> 
> In function softnic_conn_init(), a block of memory is allocated as
> connection buffer, but it is never freed in softnic_conn_free(),
> which cause memory leak.
> 
> This patch fixes it.
> 
> Fixes: 7709a63bf178 ("net/softnic: add connection agent")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
> ---
>  drivers/net/softnic/conn.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/softnic/conn.c b/drivers/net/softnic/conn.c
> index 8b66580887..a9548beac7 100644
> --- a/drivers/net/softnic/conn.c
> +++ b/drivers/net/softnic/conn.c
> @@ -146,6 +146,7 @@ softnic_conn_free(struct softnic_conn *conn)
>  	free(conn->msg_in);
>  	free(conn->prompt);
>  	free(conn->welcome);
> +	free(conn->buf);
>  	free(conn);
>  }
>  
> 

Fixed order to free in reverse order vs fields in the structure
and allocation.

Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

Applied, thanks.


      reply	other threads:[~2021-07-13  9:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09  6:00 [dpdk-stable] " dapengx.yu
2021-07-13  9:37 ` Andrew Rybchenko [this message]

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=034efec5-86f3-82c3-ff51-822b5fd1dd52@oktetlabs.ru \
    --to=andrew.rybchenko@oktetlabs.ru \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dapengx.yu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).