DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/nfp: check returned value
@ 2019-04-08 10:38 Alejandro Lucero
  2019-04-08 10:38 ` Alejandro Lucero
  2019-04-08 16:32 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 2 replies; 4+ messages in thread
From: Alejandro Lucero @ 2019-04-08 10:38 UTC (permalink / raw)
  To: dev; +Cc: stable

If the call fails just returns 0.

Coverity issue: 277225
Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfpcore/nfp_cppcore.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 2ca4283c4..dec4a8b6d 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -811,8 +811,10 @@ __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.17.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-08 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08 10:38 [dpdk-dev] [PATCH] net/nfp: check returned value Alejandro Lucero
2019-04-08 10:38 ` Alejandro Lucero
2019-04-08 16:32 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-04-08 16:32   ` Ferruh Yigit

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).