[dpdk-dev] [PATCH] crypto: fix memory leak

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Mon Jul 18 14:42:19 CEST 2016



> -----Original Message-----
> From: Pattan, Reshma
> Sent: Monday, July 18, 2016 1:32 PM
> To: De Lara Guarch, Pablo
> Cc: Doherty, Declan; dev at dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] crypto: fix memory leak
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pablo de Lara
> > Sent: Monday, July 18, 2016 1:01 PM
> > To: dev at dpdk.org
> > Cc: Doherty, Declan <declan.doherty at intel.com>; De Lara Guarch, Pablo
> > <pablo.de.lara.guarch at intel.com>
> > Subject: [dpdk-dev] [PATCH] crypto: fix memory leak
> >
> > When parsing the parameters for virtual device initialization, rte_kvargs
> > structure was being freed only if there was an error, not when parsing was
> > successful.
> >
> > Coverity issue: 124568
> >
> > Fixes: f3e764fa2fb7 ("cryptodev: uninline parameter parsing")
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
> > ---
> > --- a/lib/librte_cryptodev/rte_cryptodev.c
> > +++ b/lib/librte_cryptodev/rte_cryptodev.c
> > @@ -148,7 +148,7 @@ int
> >  	int ret;
> 
> You can initialize  ret to 0  here instead of below.

True. Thanks for this, will send a v2 shortly.

> 
> >
> >  	if (params == NULL)
> > @@ -187,10 +187,11 @@ rte_cryptodev_parse_vdev_init_params(struct
> > rte_crypto_vdev_init_params *params,
> >  		}
> >  	}
> >
> > -	return 0;
> > +	ret = 0;



More information about the dev mailing list