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 EE461A0AC2 for ; Tue, 30 Apr 2019 19:02:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D4BBE5B40; Tue, 30 Apr 2019 19:02:07 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 7AF4B58CB for ; Tue, 30 Apr 2019 19:02:06 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E073C30BA36F; Tue, 30 Apr 2019 17:02:05 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-211.ams2.redhat.com [10.36.117.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BD6A6C52C; Tue, 30 Apr 2019 17:02:04 +0000 (UTC) From: Kevin Traynor To: Alejandro Lucero Cc: dpdk stable Date: Tue, 30 Apr 2019 18:01:08 +0100 Message-Id: <20190430170133.2331-13-ktraynor@redhat.com> In-Reply-To: <20190430170133.2331-1-ktraynor@redhat.com> References: <20190430170133.2331-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 30 Apr 2019 17:02:05 +0000 (UTC) Subject: [dpdk-stable] patch 'net/nfp: check return value' has been queued to LTS release 18.11.2 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" 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 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 --- 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@dpdk.org