From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 03ACD5685 for ; Wed, 28 Sep 2016 21:30:15 +0200 (CEST) Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1bpKYY-0000Pn-5A for dev@dpdk.org; Wed, 28 Sep 2016 15:30:14 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.15.2/8.14.6) with ESMTP id u8SJK9nG020765 for ; Wed, 28 Sep 2016 15:20:09 -0400 Received: (from linville@localhost) by localhost.localdomain (8.15.2/8.15.2/Submit) id u8SJK94R020764 for dev@dpdk.org; Wed, 28 Sep 2016 15:20:09 -0400 X-Authentication-Warning: localhost.localdomain: linville set sender to linville@tuxdriver.com using -f From: "John W. Linville" To: dev@dpdk.org Date: Wed, 28 Sep 2016 15:20:02 -0400 Message-Id: <1475090404-20707-3-git-send-email-linville@tuxdriver.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475090404-20707-1-git-send-email-linville@tuxdriver.com> References: <1475090404-20707-1-git-send-email-linville@tuxdriver.com> Subject: [dpdk-dev] [PATCH 2/4] bnxt_alloc_vnic_attributes: ensure entry_length is unsigned 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: Wed, 28 Sep 2016 19:30:15 -0000 Otherwise, the inherent cast when multiplying entry_length by max_vnics in the call to rte_memzone_reserve could promote max_vnics to a signed value, causing hilarity to ensue... Coverity: 127557 Signed-off-by: John W. Linville --- drivers/net/bnxt/bnxt_vnic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index c04c4c740645..1b5f54c4d1ae 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -175,7 +175,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) struct rte_pci_device *pdev = bp->pdev; const struct rte_memzone *mz; char mz_name[RTE_MEMZONE_NAMESIZE]; - int entry_length = RTE_CACHE_LINE_ROUNDUP( + uint16_t entry_length = RTE_CACHE_LINE_ROUNDUP( HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) + HW_HASH_KEY_SIZE); uint16_t max_vnics; -- 2.7.4