]> git.droids-corp.org - dpdk.git/commitdiff
lpm6: set errno on creation error
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 24 Oct 2017 13:29:45 +0000 (16:29 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 24 Oct 2017 19:35:53 +0000 (21:35 +0200)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_lpm/rte_lpm6.c

index b4a7df348806edd5107c61f727042b6b11346fb2..5ca322c69e090f8b3342b3516c4911f03d746df6 100644 (file)
@@ -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;
        }