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 F23122B86; Thu, 29 Sep 2016 19:45:15 +0200 (CEST) Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1bpfOT-0001qm-E2; Thu, 29 Sep 2016 13:45:13 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.15.2/8.14.6) with ESMTP id u8THdtp4010192; Thu, 29 Sep 2016 13:39:55 -0400 Received: (from linville@localhost) by localhost.localdomain (8.15.2/8.15.2/Submit) id u8THdt8Z010191; Thu, 29 Sep 2016 13:39:55 -0400 X-Authentication-Warning: localhost.localdomain: linville set sender to linville@tuxdriver.com using -f From: "John W. Linville" To: dev@dpdk.org Cc: dpdk stable Date: Thu, 29 Sep 2016 13:39:34 -0400 Message-Id: <1475170776-10130-3-git-send-email-linville@tuxdriver.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475170776-10130-1-git-send-email-linville@tuxdriver.com> References: <1475090404-20707-1-git-send-email-linville@tuxdriver.com> <1475170776-10130-1-git-send-email-linville@tuxdriver.com> Subject: [dpdk-dev] [PATCH v2 2/4] net/bnxt: ensure entry_length is unsigned in bnxt_alloc_vnic_attributes 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: Thu, 29 Sep 2016 17:45:16 -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 issue: 127557 Fixes: 9738793f28ec ("net/bnxt: add VNIC functions and structs") Signed-off-by: John W. Linville --- v2: fix-up changelog entries based-on comments from Ferruh Yigit 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