Thread (15 messages) read the whole thread 15 messages, 4 authors, 2017-09-06

Re: [PATCH] cryptodev: fix NULL pointer dereference

From: Thomas Monjalon <hidden>
Date: 2017-07-31 15:22:34

31/07/2017 14:32, Sergio Gonzalez Monroy:
On 31/07/2017 03:30, Pablo de Lara wrote:
quoted
--- 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 <redacted>
NACK rte_exit/rte_panic in libraries.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help