DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: Dekel Peled <dekelp@mellanox.com>
Cc: Shahaf Shuler <shahafs@mellanox.com>, dev <dev@dpdk.org>,
	Ori Kam <orika@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix missing memory deallocation
Date: Mon, 29 Oct 2018 18:48:18 +0000	[thread overview]
Message-ID: <8720A3D8-2767-40AC-A165-68C4FE6533EE@mellanox.com> (raw)
In-Reply-To: <1540829350-45782-1-git-send-email-dekelp@mellanox.com>


> On Oct 29, 2018, at 9:09 AM, Dekel Peled <dekelp@mellanox.com> wrote:
> 
> Add freeing of allocated memroy before exiting on mlx5dv error.
> 
> Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items")
> Cc: orika@mellanox.com
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> ---

Nice catch!

Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thanks

> drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
> index 8f729f4..0e1f715 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -1203,10 +1203,12 @@
> 		dv_attr.flags |= IBV_FLOW_ATTR_FLAGS_EGRESS;
> 	cache_matcher->matcher_object =
> 		mlx5_glue->dv_create_flow_matcher(priv->ctx, &dv_attr);
> -	if (!cache_matcher->matcher_object)
> +	if (!cache_matcher->matcher_object) {
> +		rte_free(cache_matcher);
> 		return rte_flow_error_set(error, ENOMEM,
> 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
> 					  NULL, "cannot create matcher");
> +	}
> 	rte_atomic32_inc(&cache_matcher->refcnt);
> 	LIST_INSERT_HEAD(&priv->matchers, cache_matcher, next);
> 	dev_flow->dv.matcher = cache_matcher;
> -- 
> 1.8.3.1
> 

  reply	other threads:[~2018-10-29 18:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 16:09 Dekel Peled
2018-10-29 18:48 ` Yongseok Koh [this message]
2018-11-01  8:44   ` Shahaf Shuler

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=8720A3D8-2767-40AC-A165-68C4FE6533EE@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=dekelp@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=orika@mellanox.com \
    --cc=shahafs@mellanox.com \
    /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).