summaryrefslogtreecommitdiff
path: root/lib/librte_lpm
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2017-10-24 16:29:45 +0300
committerThomas Monjalon <thomas@monjalon.net>2017-10-24 21:35:53 +0200
commit490424e6c966b8a08b653ccd32c9d88e5a2716c1 (patch)
tree01ca2d4468f555a7bb87a4aa42c5ec09c6b83f1a /lib/librte_lpm
parentfa8ecf6634982b3dc7ba0d73453153a688ba72c7 (diff)
downloaddpdk-next-eventdev-490424e6c966b8a08b653ccd32c9d88e5a2716c1.zip
dpdk-next-eventdev-490424e6c966b8a08b653ccd32c9d88e5a2716c1.tar.gz
dpdk-next-eventdev-490424e6c966b8a08b653ccd32c9d88e5a2716c1.tar.xz
lpm6: set errno on creation error
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'lib/librte_lpm')
-rw-r--r--lib/librte_lpm/rte_lpm6.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c
index b4a7df3..5ca322c 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;
}