[dpdk-stable] patch 'net/nfp: check return value' has been queued to LTS release 18.11.2

Kevin Traynor ktraynor at redhat.com
Tue Apr 30 19:01:08 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.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/07/19. 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 can be viewed on a temporary branch at:
	https://github.com/kevintraynor/dpdk-stable-queue.git

Thanks.

Kevin Traynor

---
>From 3bc53e57eb490367840991d1fa08eb1fdf6ed41e Mon Sep 17 00:00:00 2001
From: Alejandro Lucero <alejandro.lucero at netronome.com>
Date: Mon, 8 Apr 2019 10:59:49 +0100
Subject: [PATCH] net/nfp: check return value

[ upstream commit 0fec453d583c77fd0e7fb61a0284dc261f2b50e3 ]

Call to CPP read (nfp_cpp_readl()) can fail, return 0 on fail.

If the call to _nfp6000_cppat_mu_locality fails, the function needs
to return with an error.

If the nfp_cpp_readl() call fails just returns 0.

Coverity issue: 277209, 277215, 277225
Fixes: c7e9729da6b5 ("net/nfp: support CPP")

Signed-off-by: Alejandro Lucero <alejandro.lucero at netronome.com>
---
 drivers/net/nfp/nfpcore/nfp-common/nfp_cppat.h | 3 +++
 drivers/net/nfp/nfpcore/nfp_cppcore.c          | 9 ++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp-common/nfp_cppat.h b/drivers/net/nfp/nfpcore/nfp-common/nfp_cppat.h
index 6e380cca0..538f882bf 100644
--- a/drivers/net/nfp/nfpcore/nfp-common/nfp_cppat.h
+++ b/drivers/net/nfp/nfpcore/nfp-common/nfp_cppat.h
@@ -369,4 +369,7 @@ _nfp6000_encode_mu(uint64_t *addr, int dest_island, int mode, int addr40,
 	locality_lsb = _nfp6000_cppat_mu_locality_lsb(mode, addr40);
 
+	if (locality_lsb < 0)
+		return NFP_ERRNO(EINVAL);
+
 	if (((*addr >> locality_lsb) & 3) == _NIC_NFP6000_MU_LOCALITY_DIRECT)
 		da = 1;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 75d3c9748..dec4a8b6d 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -802,5 +802,6 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp)
 	uint32_t model = 0;
 
-	nfp_cpp_readl(cpp, arm_id, NFP6000_ARM_GCSR_SOFTMODEL0, &model);
+	if (nfp_cpp_readl(cpp, arm_id, NFP6000_ARM_GCSR_SOFTMODEL0, &model))
+		return 0;
 
 	if (NFP_CPP_MODEL_IS_6000(model)) {
@@ -811,6 +812,8 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp)
 		/* The PL's PluDeviceID revision code is authoratative */
 		model &= ~0xff;
-		nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) +
-				   NFP_PL_DEVICE_ID, &tmp);
+		if (nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) +
+				   NFP_PL_DEVICE_ID, &tmp))
+			return 0;
+
 		model |= (NFP_PL_DEVICE_ID_MASK & tmp) - 0x10;
 	}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-04-30 17:58:14.436205965 +0100
+++ 0013-net-nfp-check-return-value.patch	2019-04-30 17:58:13.774140455 +0100
@@ -1 +1 @@
-From 0fec453d583c77fd0e7fb61a0284dc261f2b50e3 Mon Sep 17 00:00:00 2001
+From 3bc53e57eb490367840991d1fa08eb1fdf6ed41e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0fec453d583c77fd0e7fb61a0284dc261f2b50e3 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list