From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 20113A0096 for ; Mon, 8 Apr 2019 11:59:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ECB704D3A; Mon, 8 Apr 2019 11:59:52 +0200 (CEST) Received: from netronome.com (unknown [217.38.71.146]) by dpdk.org (Postfix) with ESMTP id 97BE33572; Mon, 8 Apr 2019 11:59:49 +0200 (CEST) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.15.2/8.15.2/Debian-10) with ESMTP id x389xnHu011282; Mon, 8 Apr 2019 10:59:49 +0100 Received: (from root@localhost) by netronome.com (8.15.2/8.15.2/Submit) id x389xn8e011281; Mon, 8 Apr 2019 10:59:49 +0100 From: Alejandro Lucero To: dev@dpdk.org Cc: stable@dpdk.org Date: Mon, 8 Apr 2019 10:59:49 +0100 Message-Id: <20190408095949.11236-1-alejandro.lucero@netronome.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH] net/nfp: check value returned X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Call to CPP read can fail. Coverity issue: 277209 Fixes: c7e9729da6b5 ("net/nfp: support CPP") Cc: stable@dpdk.org Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfpcore/nfp_cppcore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c index 75d3c9748..2ca4283c4 100644 --- a/drivers/net/nfp/nfpcore/nfp_cppcore.c +++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c @@ -801,7 +801,8 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp) uint32_t arm_id = NFP_CPP_ID(NFP_CPP_TARGET_ARM, 0, 0); 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)) { uint32_t tmp; -- 2.17.1