From: Ajit Khaparde Date: Mon, 7 Nov 2016 15:12:04 +0000 (-0600) Subject: net/bnxt: fix data type for vnic attributes entry size X-Git-Tag: spdx-start~5357 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f87731e05938d2dbaf17eaf0186f4b61d6aba4ab;p=dpdk.git net/bnxt: fix data type for vnic attributes entry size Prevent the arithmetic in bnxt_alloc_vnic_attributes from causing any unintentional havoc because of the usage of a signed variable. Coverity issue: 137874 Signed-off-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index 205a940d14..33fdde2fc8 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]; - uint16_t entry_length = RTE_CACHE_LINE_ROUNDUP( + uint32_t entry_length = RTE_CACHE_LINE_ROUNDUP( HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) + HW_HASH_KEY_SIZE); uint16_t max_vnics;