From 490424e6c966b8a08b653ccd32c9d88e5a2716c1 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Tue, 24 Oct 2017 16:29:45 +0300 Subject: [PATCH] lpm6: set errno on creation error Signed-off-by: Igor Ryzhov Acked-by: Bruce Richardson --- lib/librte_lpm/rte_lpm6.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c index b4a7df3488..5ca322c69e 100644 --- a/lib/librte_lpm/rte_lpm6.c +++ b/lib/librte_lpm/rte_lpm6.c @@ -191,6 +191,7 @@ rte_lpm6_create(const char *name, int socket_id, te = rte_zmalloc("LPM6_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { RTE_LOG(ERR, LPM, "Failed to allocate tailq entry!\n"); + rte_errno = ENOMEM; goto exit; } @@ -201,6 +202,7 @@ rte_lpm6_create(const char *name, int socket_id, if (lpm == NULL) { RTE_LOG(ERR, LPM, "LPM memory allocation failed\n"); rte_free(te); + rte_errno = ENOMEM; goto exit; } @@ -212,6 +214,7 @@ rte_lpm6_create(const char *name, int socket_id, rte_free(lpm); lpm = NULL; rte_free(te); + rte_errno = ENOMEM; goto exit; } -- 2.20.1