From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
stable@dpdk.org
Subject: [dpdk-stable] [PATCH 2/4] net/bnxt: fix unchecked return value
Date: Fri, 30 Apr 2021 13:14:11 -0700 [thread overview]
Message-ID: <1619813653-5161-3-git-send-email-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <1619813653-5161-1-git-send-email-ajit.khaparde@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]
Return value where return value of rte_pci_read_config was not checked.
Fix it.
Coverity issue: 349919
Fixes: 9d0cbaecc91a ("net/bnxt: support periodic FW health monitoring")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6dfb33c..4068271 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4129,13 +4129,17 @@ uint32_t bnxt_read_fw_status_reg(struct bnxt *bp, uint32_t index)
struct bnxt_error_recovery_info *info = bp->recovery_info;
uint32_t reg = info->status_regs[index];
uint32_t type, offset, val = 0;
+ int ret = 0;
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_read_config(bp->pdev, &val, sizeof(val), offset);
+ ret = rte_pci_read_config(bp->pdev, &val, sizeof(val), offset);
+ if (ret < 0)
+ PMD_DRV_LOG(ERR, "Failed to read PCI offset %#x",
+ offset);
break;
case BNXT_FW_STATUS_REG_TYPE_GRC:
offset = info->mapped_status_regs[index];
--
1.8.3.1
next prev parent reply other threads:[~2021-04-30 20:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1619813653-5161-1-git-send-email-ajit.khaparde@broadcom.com>
2021-04-30 20:14 ` [dpdk-stable] [PATCH 1/4] net/bnxt: fix mismatched type comparison Ajit Khaparde
2021-04-30 20:14 ` Ajit Khaparde [this message]
2021-04-30 20:14 ` [dpdk-stable] [PATCH 3/4] net/bnxt: fix mismatched comparison Ajit Khaparde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1619813653-5161-3-git-send-email-ajit.khaparde@broadcom.com \
--to=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).