Hi, Sorry for the delayed review. Just two small comments.
> -----Original Message----- > From: Mahmoud Maatuq <mahmoudmatook...@gmail.com> > Sent: Monday, June 24, 2024 21:42 > To: Dariusz Sosnowski <dsosnow...@nvidia.com>; Slava Ovsiienko > <viachesl...@nvidia.com>; Bing Zhao <bi...@nvidia.com>; Ori Kam > <or...@nvidia.com>; Suanming Mou <suanmi...@nvidia.com>; Matan Azrad > <ma...@nvidia.com>; Maayan Kashani <mkash...@nvidia.com> > Cc: dev@dpdk.org; Mahmoud Maatuq <mahmoudmatook...@gmail.com> > Subject: [PATCH v2] net/mlx5: fix memleak for resource object I think for clarity what resource was leaking, a better title would be: net/mlx5: fix matcher object memory leak > > this makes sure that the allocated resource object is freed for all branches > that > return NULL Typo: s/this/This/ Also, s/allocated resource object/allocated matcher object/ Also, please add a period at the end of the sentence. > Coverity issue: 426424 > Fixes: 27d171b88031 ("net/mlx5: abstract flow action and enable reconfigure") > Cc: mkash...@nvidia.com > > Signed-off-by: Mahmoud Maatuq <mahmoudmatook...@gmail.com> > --- > drivers/net/mlx5/mlx5_flow_dv.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c > index d46beffd4c..8a0d58cb05 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -12010,9 +12010,12 @@ flow_matcher_create_cb(void *tool_ctx, void > *cb_ctx) > items = *((const struct rte_flow_item **)(ctx->data2)); > resource->matcher_object = mlx5dr_bwc_matcher_create > (resource->group->tbl, resource->priority, > items); > - if (!(resource->matcher_object)) > + if (!resource->matcher_object) { > + mlx5_free(resource); > return NULL; > + } > #else > + mlx5_free(resource); > return NULL; > #endif > } > -- > 2.43.0 Best regards, Dariusz Sosnowski