DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] regex/mlx5: fix RegEx probing error flow
@ 2021-08-31 20:38 Michael Baum
  2021-09-01  7:47 ` Matan Azrad
  2021-09-01  8:11 ` Ori Kam
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Baum @ 2021-08-31 20:38 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Thomas Monjalon, Ori Kam, stable

In RegEx device probing, there is register read trying after context
device creation.

When the reading fails, the context device was not freed what caused a
memory leak.

Free it.

Fixes: f324162e8e77 ("regex/mlx5: support combined rule file")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
---
 drivers/regex/mlx5/mlx5_regex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c
index f17b6df47f..8866a4d0c6 100644
--- a/drivers/regex/mlx5/mlx5_regex.c
+++ b/drivers/regex/mlx5/mlx5_regex.c
@@ -171,7 +171,7 @@ mlx5_regex_dev_probe(struct rte_device *rte_dev)
 					    MLX5_RXP_CSR_IDENTIFIER, &val);
 	if (ret) {
 		DRV_LOG(ERR, "CSR read failed!");
-		return -1;
+		goto dev_error;
 	}
 	if (val == MLX5_RXP_BF2_IDENTIFIER)
 		priv->is_bf2 = 1;
-- 
2.25.1


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

* Re: [dpdk-dev] [PATCH] regex/mlx5: fix RegEx probing error flow
  2021-08-31 20:38 [dpdk-dev] [PATCH] regex/mlx5: fix RegEx probing error flow Michael Baum
@ 2021-09-01  7:47 ` Matan Azrad
  2021-09-01  8:11 ` Ori Kam
  1 sibling, 0 replies; 4+ messages in thread
From: Matan Azrad @ 2021-09-01  7:47 UTC (permalink / raw)
  To: Michael Baum, dev; +Cc: NBU-Contact-Thomas Monjalon, Ori Kam, stable



From: Michael Baum
> In RegEx device probing, there is register read trying after context device
> creation.
> 
> When the reading fails, the context device was not freed what caused a
> memory leak.
> 
> Free it.
> 
> Fixes: f324162e8e77 ("regex/mlx5: support combined rule file")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

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

* Re: [dpdk-dev] [PATCH] regex/mlx5: fix RegEx probing error flow
  2021-08-31 20:38 [dpdk-dev] [PATCH] regex/mlx5: fix RegEx probing error flow Michael Baum
  2021-09-01  7:47 ` Matan Azrad
@ 2021-09-01  8:11 ` Ori Kam
  2021-09-22 19:19   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Ori Kam @ 2021-09-01  8:11 UTC (permalink / raw)
  To: Michael Baum, dev; +Cc: Matan Azrad, NBU-Contact-Thomas Monjalon, stable



> -----Original Message-----
> From: Michael Baum <michaelba@nvidia.com>
> 
> In RegEx device probing, there is register read trying after context device
> creation.
> 
> When the reading fails, the context device was not freed what caused a
> memory leak.
> 
> Free it.
> 
> Fixes: f324162e8e77 ("regex/mlx5: support combined rule file")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> ---
>  drivers/regex/mlx5/mlx5_regex.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/regex/mlx5/mlx5_regex.c
> b/drivers/regex/mlx5/mlx5_regex.c index f17b6df47f..8866a4d0c6 100644
> --- a/drivers/regex/mlx5/mlx5_regex.c
> +++ b/drivers/regex/mlx5/mlx5_regex.c
> @@ -171,7 +171,7 @@ mlx5_regex_dev_probe(struct rte_device *rte_dev)
>  					    MLX5_RXP_CSR_IDENTIFIER, &val);
>  	if (ret) {
>  		DRV_LOG(ERR, "CSR read failed!");
> -		return -1;
> +		goto dev_error;
>  	}
>  	if (val == MLX5_RXP_BF2_IDENTIFIER)
>  		priv->is_bf2 = 1;
> --
> 2.25.1

Thanks,
Acked-by: Ori Kam <orika@nvidia.com>



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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] regex/mlx5: fix RegEx probing error flow
  2021-09-01  8:11 ` Ori Kam
@ 2021-09-22 19:19   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2021-09-22 19:19 UTC (permalink / raw)
  To: Michael Baum; +Cc: dev, stable, Matan Azrad, stable, Ori Kam

01/09/2021 10:11, Ori Kam:
> > From: Michael Baum <michaelba@nvidia.com>
> > 
> > In RegEx device probing, there is register read trying after context device
> > creation.
> > 
> > When the reading fails, the context device was not freed what caused a
> > memory leak.
> > 
> > Free it.
> > 
> > Fixes: f324162e8e77 ("regex/mlx5: support combined rule file")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Michael Baum <michaelba@nvidia.com>
> 
> Thanks,
> Acked-by: Ori Kam <orika@nvidia.com>

Applied, thanks.

Title changed to:
	regex/mlx5: fix leak after probing failure




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

end of thread, other threads:[~2021-09-22 19:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 20:38 [dpdk-dev] [PATCH] regex/mlx5: fix RegEx probing error flow Michael Baum
2021-09-01  7:47 ` Matan Azrad
2021-09-01  8:11 ` Ori Kam
2021-09-22 19:19   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

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