DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix missing memory deallocation
@ 2018-10-29 16:09 Dekel Peled
  2018-10-29 18:48 ` Yongseok Koh
  0 siblings, 1 reply; 3+ messages in thread
From: Dekel Peled @ 2018-10-29 16:09 UTC (permalink / raw)
  To: yskoh, shahafs; +Cc: dev, orika

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>
---
 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix missing memory deallocation
  2018-10-29 16:09 [dpdk-dev] [PATCH] net/mlx5: fix missing memory deallocation Dekel Peled
@ 2018-10-29 18:48 ` Yongseok Koh
  2018-11-01  8:44   ` Shahaf Shuler
  0 siblings, 1 reply; 3+ messages in thread
From: Yongseok Koh @ 2018-10-29 18:48 UTC (permalink / raw)
  To: Dekel Peled; +Cc: Shahaf Shuler, dev, Ori Kam


> 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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix missing memory deallocation
  2018-10-29 18:48 ` Yongseok Koh
@ 2018-11-01  8:44   ` Shahaf Shuler
  0 siblings, 0 replies; 3+ messages in thread
From: Shahaf Shuler @ 2018-11-01  8:44 UTC (permalink / raw)
  To: Yongseok Koh, Dekel Peled; +Cc: dev, Ori Kam

Monday, October 29, 2018 8:48 PM, Yongseok Koh:
> Subject: Re: [PATCH] net/mlx5: fix missing memory deallocation
> 
> 
> > 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>

Applied to next-net-mlx, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-01  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-29 16:09 [dpdk-dev] [PATCH] net/mlx5: fix missing memory deallocation Dekel Peled
2018-10-29 18:48 ` Yongseok Koh
2018-11-01  8:44   ` Shahaf Shuler

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).