From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 84DF9A054F; Tue, 16 Mar 2021 06:19:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E6084069F; Tue, 16 Mar 2021 06:19:16 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.232.172]) by mails.dpdk.org (Postfix) with ESMTP id A64CB40042 for ; Tue, 16 Mar 2021 06:19:14 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 30AF77DAE; Mon, 15 Mar 2021 22:19:12 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 30AF77DAE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1615871954; bh=7ZZDMSn1Id86pXHXa5PCS9mihhQta7+WolBHv3iGTWo=; h=From:To:Cc:Subject:Date:From; b=fSN233dU20rNWxdSwEnBalMWdTq4BaBv4dj7Kmwz6fEUbfxCVZkKcVZGE37g6iidz mfY3oN3y75zoiQ1lCxkSAGm29EYu6yGLPzm3N6AP0Xg1i4NqvWRrLeP+Styd2rYJuf 1xGYjHlhdOhBDJlisTjxSi+U2wzBsZqA3iNTFMzM= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Tue, 16 Mar 2021 11:11:25 +0530 Message-Id: <20210316054125.980-1-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 Subject: [dpdk-dev] [PATCH] net/bnxt: fix unchecked return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Kalesh AP CID 363716 (#1 of 1): Unchecked return value (CHECKED_RETURN) check_return: Calling rte_pci_write_config without checking return value (as is done elsewhere 46 out of 49 times). Coverity issue: 363716 Fixes: be14720def9c ("net/bnxt: support FW reset") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ethdev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 6cc6af0..202b082 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3860,13 +3860,19 @@ static void bnxt_write_fw_reset_reg(struct bnxt *bp, uint32_t index) uint32_t val = info->reset_reg_val[index]; uint32_t reg = info->reset_reg[index]; uint32_t type, offset; + int ret; type = BNXT_FW_STATUS_REG_TYPE(reg); offset = BNXT_FW_STATUS_REG_OFF(reg); switch (type) { case BNXT_FW_STATUS_REG_TYPE_CFG: - rte_pci_write_config(bp->pdev, &val, sizeof(val), offset); + ret = rte_pci_write_config(bp->pdev, &val, sizeof(val), offset); + if (ret < 0) { + PMD_DRV_LOG(ERR, "Failed to write %#x at PCI offset %#x", + val, offset); + return; + } break; case BNXT_FW_STATUS_REG_TYPE_GRC: offset = bnxt_map_reset_regs(bp, offset); -- 2.10.1