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 05C0DA0096 for ; Mon, 8 Apr 2019 12:10:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B427D4CA9; Mon, 8 Apr 2019 12:10:11 +0200 (CEST) Received: from netronome.com (unknown [217.38.71.146]) by dpdk.org (Postfix) with ESMTP id 5C2262BD8; Mon, 8 Apr 2019 12:10:08 +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 x38AA8NP007752; Mon, 8 Apr 2019 11:10:08 +0100 Received: (from root@localhost) by netronome.com (8.15.2/8.15.2/Submit) id x38AA8PC007751; Mon, 8 Apr 2019 11:10:08 +0100 From: Alejandro Lucero To: dev@dpdk.org Cc: stable@dpdk.org Date: Mon, 8 Apr 2019 11:10:08 +0100 Message-Id: <20190408101008.7706-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" If the call to _nfp6000_cppat_mu_locality fails, the function needs to return with an error. Coverity issue: 277215 Fixes: c7e9729da6b5 ("net/nfp: support CPP") Cc: stable@dpdk.org Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfpcore/nfp-common/nfp_cppat.h | 3 +++ 1 file changed, 3 insertions(+) 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 @@ -368,6 +368,9 @@ _nfp6000_encode_mu(uint64_t *addr, int dest_island, int mode, int addr40, isld[1] = isld1; 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; else -- 2.17.1