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 CB9B1A0096 for ; Mon, 8 Apr 2019 11:59:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D926E378E; Mon, 8 Apr 2019 11:59:50 +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-dev] [PATCH] net/nfp: check value returned X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190408095949.AGby1esNJzh3fa9SQ4vnW8IvZRMfZSTKnULdBsUwJNM@z> 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