[dpdk-stable] patch 'net/ice: check some functions return' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:00:11 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/604068df872c511a76b059e7d006a1e200b4a810

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 604068df872c511a76b059e7d006a1e200b4a810 Mon Sep 17 00:00:00 2001
From: Wenjun Wu <wenjun1.wu at intel.com>
Date: Fri, 26 Feb 2021 15:22:00 +0800
Subject: [PATCH] net/ice: check some functions return
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 32667f5b48a371cd65c35d26c61ea293745e1b44 ]

Fix unchecked return values reported by coverity.

Coverity issue: 349907
Fixes: 03a05924dad0 ("net/ice: support device-specific DDP package loading")

Signed-off-by: Wenjun Wu <wenjun1.wu at intel.com>
---
 drivers/net/ice/ice_ethdev.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index d789650652..626ebfac5b 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1768,8 +1768,14 @@ ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 	pos = rte_pci_find_ext_capability(pci_dev, RTE_PCI_EXT_CAP_ID_DSN);
 
 	if (pos) {
-		rte_pci_read_config(pci_dev, &dsn_low, 4, pos + 4);
-		rte_pci_read_config(pci_dev, &dsn_high, 4, pos + 8);
+		if (rte_pci_read_config(pci_dev, &dsn_low, 4, pos + 4) < 0) {
+			PMD_INIT_LOG(ERR, "Failed to read pci config space\n");
+			return -1;
+		}
+		if (rte_pci_read_config(pci_dev, &dsn_high, 4, pos + 8) < 0) {
+			PMD_INIT_LOG(ERR, "Failed to read pci config space\n");
+			return -1;
+		}
 		snprintf(opt_ddp_filename, ICE_MAX_PKG_FILENAME_SIZE,
 			 "ice-%08x%08x.pkg", dsn_high, dsn_low);
 	} else {
@@ -1831,7 +1837,11 @@ static int ice_load_pkg(struct rte_eth_dev *dev)
 	struct ice_adapter *ad =
 		ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 
-	ice_pkg_file_search_path(pci_dev, pkg_file);
+	err = ice_pkg_file_search_path(pci_dev, pkg_file);
+	if (err) {
+		PMD_INIT_LOG(ERR, "failed to search file path\n");
+		return err;
+	}
 
 	file = fopen(pkg_file, "rb");
 	if (!file)  {
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:28.264165500 +0800
+++ 0063-net-ice-check-some-functions-return.patch	2021-05-10 23:59:26.420000000 +0800
@@ -1 +1 @@
-From 32667f5b48a371cd65c35d26c61ea293745e1b44 Mon Sep 17 00:00:00 2001
+From 604068df872c511a76b059e7d006a1e200b4a810 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 32667f5b48a371cd65c35d26c61ea293745e1b44 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -18 +20 @@
-index 8999d441ac..9c9b84a938 100644
+index d789650652..626ebfac5b 100644
@@ -21 +23 @@
-@@ -1663,8 +1663,14 @@ ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
+@@ -1768,8 +1768,14 @@ ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
@@ -38 +40 @@
-@@ -1727,7 +1733,11 @@ static int ice_load_pkg(struct rte_eth_dev *dev)
+@@ -1831,7 +1837,11 @@ static int ice_load_pkg(struct rte_eth_dev *dev)


More information about the stable mailing list