Hi Thomas, > -----Original Message----- > From: dev [mailto:[email protected]] On Behalf Of Thomas Monjalon > Sent: Monday, July 31, 2017 4:23 PM > To: De Lara Guarch, Pablo <[email protected]> > Cc: [email protected]; Gonzalez Monroy, Sergio > <[email protected]>; Doherty, Declan > <[email protected]> > Subject: Re: [dpdk-dev] [PATCH] cryptodev: fix NULL pointer dereference > > 31/07/2017 14:32, Sergio Gonzalez Monroy: > > On 31/07/2017 03:30, Pablo de Lara wrote: > > > --- a/lib/librte_cryptodev/rte_cryptodev.c > > > +++ b/lib/librte_cryptodev/rte_cryptodev.c > > > @@ -1404,6 +1404,12 @@ rte_cryptodev_allocate_driver(const struct > rte_driver *drv) > > > struct cryptodev_driver *driver; > > > > > > driver = malloc(sizeof(*driver)); > > > + > > > + if (driver == NULL) > > > + rte_exit(EXIT_FAILURE, > > > + "Could not allocate memory for crypto driver %u\n", > > > + nb_drivers); > > > + > > > driver->driver = drv; > > > driver->id = nb_drivers; > > > > > > > Acked-by: Sergio Gonzalez Monroy <[email protected]> > > NACK rte_exit/rte_panic in libraries.
I have sent a v2 that allocates statically the structure, instead of calling malloc, so no rte_exit is required. Thanks, Pablo

