From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by dpdk.org (Postfix) with ESMTP id 306381B7FD for ; Tue, 24 Oct 2017 15:28:38 +0200 (CEST) Received: by mail-lf0-f68.google.com with SMTP id w21so24048450lfc.6 for ; Tue, 24 Oct 2017 06:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nfware-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=3LFOoULw4965SsA3JUSGe8eE8YJiEVB4cWPWmp+yo+c=; b=cxu1iScCdSUTJ2nBGYwZTQEdotqeZcBSMIK2/MeIclTxNrk3MV1fSbaufWBX7/7x9P MW+249JeJf9Z4e5H9ZvZqELvGUUrC9PR6o2hTZbvX4ntWDoZH2UeEzKCnDcgBfz9dtOw /uYXp1I6sd4dmH6+k3ZQtSXxHLR7U1R9lwba/vRqEN7/7huBuYuIks//A5RgN9lJtW20 rnvdY0OukC+kbKmBTNkkHvNaxV0WhyuwKSDUxjL+vZMgs5pVvqP0vlSdavUdQVVEaFwC gwVe+wV8z8AWdeErUyvQHqsaXGpRU8i5n33UjlbVrscSAT0MngDAXNmV07egULiLxT9v UWbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=3LFOoULw4965SsA3JUSGe8eE8YJiEVB4cWPWmp+yo+c=; b=kkybGxweijOQQyjd76MKEVaq4BUgUONj1Q5SlxLgFlELY0m1D5r5goMnbOtUdQxjlL 3gOVORREB0V2gr2rK6lNFtGMO70oFZHip8i53oW0EjFDG7VqYbJmMGbqeJqDD0uJbG3l BRvBxg53VX6BQdxtoFeIz7gFJZYzFSfxr6wZIoslkRmuVAsF9mx+bGwLgS401cPD5vzB YoGwFkXM25IXeCqA2nNSVtDJfuOTPc/wZZHsnuFD4Rkvd7Cpo4Zzt2sCCt86t6Nd0hQ9 pW+MNzd4a8Kk/+Is1U2uR6QP8Nvx8EGt/WXDoJIdvBMurhVd9JoiPbwJXdiCs8U3qrPW /zmw== X-Gm-Message-State: AMCzsaVAq+JpDM9midmcBiHKJH66DQyvM3GFwdaqj3XmNSDmV4RLUlQz eLK6g5GTspCV1aiN7ZpQbrxFo3fG X-Google-Smtp-Source: ABhQp+TRMAqVxo8zavbd6M/5ZuwArcZoYS6D1T5xOKuF+tRri6JcEyMwxR5C/Z4Ml2xPYbDkwCIxGQ== X-Received: by 10.46.23.85 with SMTP id l82mr6574032lje.178.1508851717355; Tue, 24 Oct 2017 06:28:37 -0700 (PDT) Received: from localhost.localdomain ([195.34.30.205]) by smtp.gmail.com with ESMTPSA id f21sm77367lja.25.2017.10.24.06.28.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Oct 2017 06:28:36 -0700 (PDT) From: Igor Ryzhov To: dev@dpdk.org Date: Tue, 24 Oct 2017 16:28:30 +0300 Message-Id: <1508851710-54504-1-git-send-email-iryzhov@nfware.com> X-Mailer: git-send-email 2.6.4 Subject: [dpdk-dev] [PATCH] lpm: set errno on creation error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Oct 2017 13:28:38 -0000 Signed-off-by: Igor Ryzhov --- lib/librte_lpm/rte_lpm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index 64c074e..140dbb2 100644 --- a/lib/librte_lpm/rte_lpm.c +++ b/lib/librte_lpm/rte_lpm.c @@ -218,6 +218,7 @@ rte_lpm_create_v20(const char *name, int socket_id, int max_rules, te = rte_zmalloc("LPM_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { RTE_LOG(ERR, LPM, "Failed to allocate tailq entry\n"); + rte_errno = ENOMEM; goto exit; } @@ -227,6 +228,7 @@ rte_lpm_create_v20(const char *name, int socket_id, int max_rules, if (lpm == NULL) { RTE_LOG(ERR, LPM, "LPM memory allocation failed\n"); rte_free(te); + rte_errno = ENOMEM; goto exit; } @@ -292,6 +294,7 @@ rte_lpm_create_v1604(const char *name, int socket_id, te = rte_zmalloc("LPM_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { RTE_LOG(ERR, LPM, "Failed to allocate tailq entry\n"); + rte_errno = ENOMEM; goto exit; } @@ -301,6 +304,7 @@ rte_lpm_create_v1604(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; } @@ -312,6 +316,7 @@ rte_lpm_create_v1604(const char *name, int socket_id, rte_free(lpm); lpm = NULL; rte_free(te); + rte_errno = ENOMEM; goto exit; } @@ -324,6 +329,7 @@ rte_lpm_create_v1604(const char *name, int socket_id, rte_free(lpm); lpm = NULL; rte_free(te); + rte_errno = ENOMEM; goto exit; } -- 2.6.4