From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from netronome.com (unknown [217.38.71.146]) by dpdk.org (Postfix) with ESMTP id 243752B95; Mon, 8 Apr 2019 11:39:57 +0200 (CEST) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.15.2/8.15.2/Debian-10) with ESMTP id x389duUa020188; Mon, 8 Apr 2019 10:39:56 +0100 Received: (from root@localhost) by netronome.com (8.15.2/8.15.2/Submit) id x389duPB020187; Mon, 8 Apr 2019 10:39:56 +0100 From: Alejandro Lucero To: dev@dpdk.org Cc: stable@dpdk.org Date: Mon, 8 Apr 2019 10:39:56 +0100 Message-Id: <20190408093956.20142-1-alejandro.lucero@netronome.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/nfp: fix potential integer overflow 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: Mon, 08 Apr 2019 09:39:57 -0000 Coverity issue: 277204 Fixes: defb9a5dd156 ("nfp: introduce driver initialization") Cc: stable@dpdk.org Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfp_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 50058e056..d4c94d7cc 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2855,9 +2855,9 @@ nfp_net_init(struct rte_eth_dev *eth_dev) case PCI_DEVICE_ID_NFP6000_PF_NIC: case PCI_DEVICE_ID_NFP6000_VF_NIC: start_q = nn_cfg_readl(hw, NFP_NET_CFG_START_TXQ); - tx_bar_off = start_q * NFP_QCP_QUEUE_ADDR_SZ; + tx_bar_off = (uint64_t)start_q * NFP_QCP_QUEUE_ADDR_SZ; start_q = nn_cfg_readl(hw, NFP_NET_CFG_START_RXQ); - rx_bar_off = start_q * NFP_QCP_QUEUE_ADDR_SZ; + rx_bar_off = (uint64_t)start_q * NFP_QCP_QUEUE_ADDR_SZ; break; default: PMD_DRV_LOG(ERR, "nfp_net: no device ID matching"); -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A99B6A0096 for ; Mon, 8 Apr 2019 11:39:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 664A52BCE; Mon, 8 Apr 2019 11:39:58 +0200 (CEST) Received: from netronome.com (unknown [217.38.71.146]) by dpdk.org (Postfix) with ESMTP id 243752B95; Mon, 8 Apr 2019 11:39:57 +0200 (CEST) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.15.2/8.15.2/Debian-10) with ESMTP id x389duUa020188; Mon, 8 Apr 2019 10:39:56 +0100 Received: (from root@localhost) by netronome.com (8.15.2/8.15.2/Submit) id x389duPB020187; Mon, 8 Apr 2019 10:39:56 +0100 From: Alejandro Lucero To: dev@dpdk.org Cc: stable@dpdk.org Date: Mon, 8 Apr 2019 10:39:56 +0100 Message-Id: <20190408093956.20142-1-alejandro.lucero@netronome.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/nfp: fix potential integer overflow 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190408093956.w-XgdeOrJkU9zfyE1-137PURCJxkixLY1zvlCEnI7qA@z> Coverity issue: 277204 Fixes: defb9a5dd156 ("nfp: introduce driver initialization") Cc: stable@dpdk.org Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfp_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 50058e056..d4c94d7cc 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2855,9 +2855,9 @@ nfp_net_init(struct rte_eth_dev *eth_dev) case PCI_DEVICE_ID_NFP6000_PF_NIC: case PCI_DEVICE_ID_NFP6000_VF_NIC: start_q = nn_cfg_readl(hw, NFP_NET_CFG_START_TXQ); - tx_bar_off = start_q * NFP_QCP_QUEUE_ADDR_SZ; + tx_bar_off = (uint64_t)start_q * NFP_QCP_QUEUE_ADDR_SZ; start_q = nn_cfg_readl(hw, NFP_NET_CFG_START_RXQ); - rx_bar_off = start_q * NFP_QCP_QUEUE_ADDR_SZ; + rx_bar_off = (uint64_t)start_q * NFP_QCP_QUEUE_ADDR_SZ; break; default: PMD_DRV_LOG(ERR, "nfp_net: no device ID matching"); -- 2.17.1