From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by dpdk.org (Postfix) with ESMTP id 5D25E8E5C for ; Sun, 16 Aug 2015 21:09:04 +0200 (CEST) Received: by wicja10 with SMTP id ja10so55442464wic.1 for ; Sun, 16 Aug 2015 12:09:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RXv/IzshTvQroCOO8O3BjdIsGEK22CRN1UXuLrY3qS0=; b=QSJSufqVtrEp3vRR7mzSscqY9UT8hrM+UamwXKPS1ghOaBha6cLoPWu8F1pGfCZ2qG BXCxYJyugPCJu1q09JIFwJ9MnJMgWzrJ8dA4fBU7x/b7pSBoKPwH2tHAGblzbxrP0Raz Ur54Qa8W32c4XmUs90QvX2mXYFNLi+5sNb4goBtgVh2Ha5TbJSKu+uHFYWMtCOTc3mhF R6HfL3jm6iO1Im3KG496bDefUycT8fvwc5WFHjnN3+JpGRIsJsg5Z+w01zM5HOHuURa7 3x4FZvGtPOg0BRrW0hOv/w2UIAv89hy1Zpv9gVWCijoHfFkzchBlS8Yca0gqmJJcA//n 44IA== X-Gm-Message-State: ALoCoQkwWsDu80LdO+/aON61TOYIrSUSyO/GkR+f1tfe43/tMM6pMBYMYUC9Kdn+pXsnuGUCzB4T X-Received: by 10.194.9.102 with SMTP id y6mr14498410wja.91.1439752144187; Sun, 16 Aug 2015 12:09:04 -0700 (PDT) Received: from nitrogen.home.aloni.org ([5.102.224.173]) by smtp.gmail.com with ESMTPSA id ma4sm18369180wjb.38.2015.08.16.12.09.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Aug 2015 12:09:03 -0700 (PDT) From: Dan Aloni To: Olivier Matz Date: Sun, 16 Aug 2015 22:08:19 +0300 Message-Id: <1439752099-23090-1-git-send-email-dan@kernelim.com> X-Mailer: git-send-email 2.4.3 Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH] mempool: fix the inverted pg_num check on create X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2015 19:09:04 -0000 The rest of the code expects pg_num <= RTE_DIM(mp->elt_pa). Signed-off-by: Dan Aloni --- lib/librte_mempool/rte_mempool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 8e185c545479..edcfa8bf9cb1 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -461,7 +461,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size, } /* Check that pg_num and pg_shift parameters are valid. */ - if (pg_num < RTE_DIM(mp->elt_pa) || pg_shift > MEMPOOL_PG_SHIFT_MAX) { + if (pg_num > RTE_DIM(mp->elt_pa) || pg_shift > MEMPOOL_PG_SHIFT_MAX) { rte_errno = EINVAL; return NULL; } -- 2.4.3