From mboxrd@z Thu Jan 1 00:00:00 1970 From: Igor Ryzhov Subject: [PATCH] lpm6: set errno on creation error Date: Tue, 24 Oct 2017 16:29:45 +0300 Message-ID: <1508851785-54623-1-git-send-email-iryzhov@nfware.com> To: dev@dpdk.org Return-path: Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by dpdk.org (Postfix) with ESMTP id 606671B7FD for ; Tue, 24 Oct 2017 15:29:53 +0200 (CEST) Received: by mail-lf0-f65.google.com with SMTP id w21so24053434lfc.6 for ; Tue, 24 Oct 2017 06:29:53 -0700 (PDT) Received: from localhost.localdomain ([195.34.30.205]) by smtp.gmail.com with ESMTPSA id l88sm60614lfi.36.2017.10.24.06.29.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Oct 2017 06:29:51 -0700 (PDT) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Igor Ryzhov --- 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 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; } -- 2.6.4