From patchwork Tue Jun 25 17:33:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 13711740 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD6FBA20; Tue, 25 Jun 2024 17:34:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336852; cv=none; b=fVT29GWUzrc/nr+jEJ6hsRPW7jbDLJbNnhFRKZ9m4MU/dZeFfA9LcfjIy3zxS7fwROzTSgh6KuKAZ1u2UFBXMiJ0kzX0ob2fuyaEplUqRxw6UwPeFnlWzhsGBtIyHzZlF9XdG9juDOU7epr7aCZllPBHAk6gTvH1Eb1fesw4olM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336852; c=relaxed/simple; bh=nvg2bDyu97UFY7UtAM4glGoAg2abvvoKxXSCMlGpmmg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=D7AkRgf10KkaNhJNZlmuF4Z4LedkBYnkK93G4fySQFAbKI6jSqhZ0w8JCoaEg2XgdSl898jcPUvQnegLkpDnXMjOsC9QKIMEuZ7rtVgcG7xFBNEC3vC8o8NxS0DkV3w8+IOPOhdM4Lwp0IdoQFK1ZCa42OczDQh3gemm6h0jrDE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=TqDlTECh; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="TqDlTECh" Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45P8sUvB006267; Tue, 25 Jun 2024 10:34:04 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=B s4dvTdVkjOQxvYbHqJg9rN6SsX5DycL0uN69uYr4MY=; b=TqDlTEChkegIDQO5D gbqipLKtYtfqbEZqF1Pu6hhzy3f47z1feLeeILMhoKDkUEQCjv2hcYqr0hzuewfV NQRyARtGlFWd3tjFhpEKSgO4ta/oEihWa3eklQurtqZFIdKG8o1SZ6SiT/3DrggJ UC3idIQ3dLDfP3C0ms0Ltq3wasx+VCvEK83kmXHVS1IhloddOF9EP2/TkTsMD2p8 EKsP1ZuxGUvjynNneJX5hQejYru+pa2t+ajUZfuq0L2KRJhg9Vo/1ABGiVncKPhP +cfwXcBaEwchYMDZG3N1Z6REevOzX9QOZMQvh0+P85ZVqoVfU0ztpbIPVEogYIB0 w3vaA== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3yytt0a2v0-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 10:34:04 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 25 Jun 2024 10:34:02 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 25 Jun 2024 10:34:02 -0700 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id ECAF83F7063; Tue, 25 Jun 2024 10:33:58 -0700 (PDT) From: Suman Ghosh To: , , , , , , , , , , , , CC: Suman Ghosh Subject: [net PATCH v2 1/7] octeontx2-af: Fix klockwork issue in cgx.c Date: Tue, 25 Jun 2024 23:03:43 +0530 Message-ID: <20240625173350.1181194-2-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240625173350.1181194-1-sumang@marvell.com> References: <20240625173350.1181194-1-sumang@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: vrbSNRk-xEbkxA1xGIQSZOGXwmtCCOSZ X-Proofpoint-GUID: vrbSNRk-xEbkxA1xGIQSZOGXwmtCCOSZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-25_12,2024-06-25_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org Variable "cgx_dev" and "lmac" was getting accessed without NULL checks which can lead to pointer exception in some erroneous scenarios. This patch fixes the same by adding the required NULL checks. Fixes: 96be2e0da85e ("octeontx2-af: Support for MAC address filters in CGX") Signed-off-by: Suman Ghosh --- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c index 27935c54b91b..e5e266608cfc 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c @@ -465,6 +465,13 @@ u64 cgx_lmac_addr_get(u8 cgx_id, u8 lmac_id) u64 cfg; int id; + if (!cgx_dev) + return 0; + + lmac = lmac_pdata(lmac_id, cgx_dev); + if (!lmac) + return 0; + mac_ops = cgx_dev->mac_ops; id = get_sequence_id_of_lmac(cgx_dev, lmac_id); From patchwork Tue Jun 25 17:33:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 13711742 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB415178399; Tue, 25 Jun 2024 17:34:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336863; cv=none; b=NyuVsTfvRCJ7Fuu3rcG33RNgCAQx8GPT/yIZ9HpTcv3TGSO621Q3DGLl8/WiOUqEonv3+ZIVWZYtWKRzID25EpRrT8VDejY9GxWg+jc21h+gvTu6zYEUVHMZ5Ix5EONX2PvYgqCA+2dRKZtsZN/c0zAqanb5TyZgwnf70RAea+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336863; c=relaxed/simple; bh=MwR2+x33tL23zCDtW1vXkjUKW66d5cZi7iJ5mbn+RTc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jKtjED/QIXSJzP40mEPwhAkGQS/c/SVTbo5szJxxR8DSytOEUHjdQO7DyJw1jfjpTUibsbOmjwEJ+x1d6jzcZZlO6vzxqFhFvJMRHaL0tpphTpu8ePyyzZFOc1y8vH+2FEFhNAwVMND1RJYP/DOfzapx/knTXKT9OzpAn7Z1ZIk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=DgY0uBRP; arc=none smtp.client-ip=67.231.156.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="DgY0uBRP" Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PBtIf4000832; Tue, 25 Jun 2024 10:34:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=s 3jdL6UcGGq24YBU3TnKztOmwHWjNtaB4Og6RDixtc4=; b=DgY0uBRPUIfGQiK7Q ImQ1ZABotrYDzVls9PVQUIEbpKo0ETk/EdVnQzAFaDgrOPt+INheMPgaCPIdt2AT L1EoqQEGPBp7awWY28TcVP4fFCM1jWrE3iW1MNwc/0K7IeUqKv89aVrDR3f/T1pV 3ESnISF3R+6AoIthyDoQvm8zErDRqNv8gkUo9OGnKr8g+I1ycmwo0L2HoZWHktht rjeL7ZAL7YQvoXHGetMA38rEXybL0Ucu6A2bnDkowNgMWASECsUHWMZHWpAHVZqZ VKBKexYRSxJhsNQh7lJdpp7BBSGQdXQI+MugDcHZY2N983Z22fVqon791s0jmuD0 UPO8A== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3yywec9khc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 10:34:15 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 25 Jun 2024 10:34:14 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 25 Jun 2024 10:34:14 -0700 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id 2FE1C3F706B; Tue, 25 Jun 2024 10:34:09 -0700 (PDT) From: Suman Ghosh To: , , , , , , , , , , , , CC: Suman Ghosh Subject: [net PATCH 2/7] octeontx2-af: Fix klockwork issues in mcs_rvu_if.c Date: Tue, 25 Jun 2024 23:03:45 +0530 Message-ID: <20240625173350.1181194-4-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240625173350.1181194-1-sumang@marvell.com> References: <20240625173350.1181194-1-sumang@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 4-xcnGtU8O9JCrCWuow3GhmRvP2SH1ew X-Proofpoint-GUID: 4-xcnGtU8O9JCrCWuow3GhmRvP2SH1ew X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-25_12,2024-06-25_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org These are not real issues but sanity checks. Fixes: cfc14181d497 ("octeontx2-af: cn10k: mcs: Manage the MCS block hardware resources") Signed-off-by: Suman Ghosh --- drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c b/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c index d39d86e694cc..de4482dee86a 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c @@ -681,7 +681,7 @@ int rvu_mbox_handler_mcs_alloc_resources(struct rvu *rvu, u16 pcifunc = req->hdr.pcifunc; struct mcs_rsrc_map *map; struct mcs *mcs; - int rsrc_id, i; + int rsrc_id = -EINVAL, i; if (req->mcs_id >= rvu->mcs_blk_cnt) return MCS_AF_ERR_INVALID_MCSID; @@ -742,6 +742,8 @@ int rvu_mbox_handler_mcs_alloc_resources(struct rvu *rvu, rsp->rsrc_cnt++; } break; + default: + goto exit; } rsp->rsrc_type = req->rsrc_type; @@ -854,7 +856,7 @@ int rvu_mbox_handler_mcs_ctrl_pkt_rule_write(struct rvu *rvu, static void rvu_mcs_set_lmac_bmap(struct rvu *rvu) { struct mcs *mcs = mcs_get_pdata(0); - unsigned long lmac_bmap; + unsigned long lmac_bmap = 0; int cgx, lmac, port; for (port = 0; port < mcs->hw->lmac_cnt; port++) { From patchwork Tue Jun 25 17:33:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 13711743 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E26E8176225; Tue, 25 Jun 2024 17:34:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336869; cv=none; b=h+tAMi1V2fBMsQjO9TQJz4VR+BZIdceeiWSckrnD0UA0eBw3JUrqlabJTtr4ps34YD5rc33MeOnzng5y/pMVlwc5HVRRIGjbd6xhe1dpQWD0K1plZiJPM0QHwX7ZHl07TX1Ra9Cvs7Kt8TkvGa8Yyxg+VTZtuXDiOq7vgesiH04= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336869; c=relaxed/simple; bh=bkFXXtybeIIeB2Aly3JWUWb9QAZ4GZQdcOk755ZIB9Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UZRhjuTxGNcQ142h2WD3zgFU38PkjriPAg+cDVg9HtE/xautLJrOB6/r2VVhLgO0eKXKRbkrl4aOW1ULkqlPzo626Gx4pQFBV079qOFgl4cby9niUk4SobT6FHnZaqEKeUjkIEWB1Ii8YLcRHZESoYp4/YBB2lBCteM3tqToTIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=OoK0ZjwL; arc=none smtp.client-ip=67.231.156.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="OoK0ZjwL" Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PBtVs2001297; Tue, 25 Jun 2024 10:34:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=7 GAHobpstThpXVRaOFsKpqXzXf99LKM0bNB7ZDQ7cYU=; b=OoK0ZjwLKDMqjduhc y9xovMT6z9b9fOF2/Qh9w8HcPEEe0vpRYECWqWJwm8JjrHYjm1dd5E2+7EDgbyAF 5QvKjIcxROaQ7tw7tzGVdat38+gxTCLMsuaunymEOCZkH/NpMrOYfRdl8Kc8y2JX 2K4QIEYtacLXPqzBEOHTohLFvsn6e6kmx4yAOaVrQN4IiRb4fb1tgPdIQnilIjNK 42fY7eSW2B0wXSVm8j819uak2Tgq3rten2wT377+Xt4EAbYwfz51yHju9GroWzTM FeJttJ9V6UQ/DlcvFiGqzdkRtzFY1NaFtQZDqcvrG02xdw4s2vvtKqQEL20aIPak dJWww== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3yywec9kj1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 10:34:21 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 25 Jun 2024 10:34:19 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 25 Jun 2024 10:34:19 -0700 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id AB7563F707D; Tue, 25 Jun 2024 10:34:15 -0700 (PDT) From: Suman Ghosh To: , , , , , , , , , , , , CC: Suman Ghosh Subject: [net PATCH v2 3/7] octeontx2-af: Fixes klockwork issues in ptp.c Date: Tue, 25 Jun 2024 23:03:46 +0530 Message-ID: <20240625173350.1181194-5-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240625173350.1181194-1-sumang@marvell.com> References: <20240625173350.1181194-1-sumang@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: taMw7Hfxg28YSwJM13yhG8jwMffnr_mS X-Proofpoint-GUID: taMw7Hfxg28YSwJM13yhG8jwMffnr_mS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-25_12,2024-06-25_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org Some variable was getting accessed without NULL checks which can lead to pointer exception in some erroneous scenarios. This patch fixes the same by adding the required NULL checks. Fixes: 4086f2a06a35 ("octeontx2-af: Add support for Marvell PTP coprocessor") Signed-off-by: Suman Ghosh --- drivers/net/ethernet/marvell/octeontx2/af/ptp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c index bcc96eed2481..0be5d22d213b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c @@ -517,6 +517,7 @@ static int ptp_pps_on(struct ptp *ptp, int on, u64 period) static int ptp_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { + void __iomem * const *base; struct ptp *ptp; int err; @@ -536,7 +537,15 @@ static int ptp_probe(struct pci_dev *pdev, if (err) goto error_free; - ptp->reg_base = pcim_iomap_table(pdev)[PCI_PTP_BAR_NO]; + base = pcim_iomap_table(pdev); + if (!base) + goto error_free; + + ptp->reg_base = base[PCI_PTP_BAR_NO]; + if (!ptp->reg_base) { + err = -ENODEV; + goto error_free; + } pci_set_drvdata(pdev, ptp); if (!first_ptp_block) From patchwork Tue Jun 25 17:33:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 13711744 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F26D176225; Tue, 25 Jun 2024 17:34:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336873; cv=none; b=qJw3SmG8HTU0zGlg1GrGS9hl/D3MNqLjDSpqC55034dDrY1fSr6iPba/gTnzeszqlE2yil7nc8PJg6WV4wwUWMEfmRhDplmQv9yl/LT1j203Um66h1MwKz3aAC5HCBO3w/Hh4Qx76aZPaogDSlKx+RlNRhvLybt6lk8HSoX5hbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336873; c=relaxed/simple; bh=Vyv0SWOwJ6qrJ8qPCzeftxln8S3HT97YjuWhON2Runs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ge5QYfJtPyEIbnFRTBdptQYRt90CHKlJRQVIIL3XgBDttcjCYdvEWaJOZ0tXriVPrAVRsRVC1nlc3C0Zp4F2ZzVNmVe4f+zRgC8X6v3CK/n3OwvS0xou45QwdTpoQjaUH9tIDmNShCW7YZ4abBWr47TuIeDjqQjMrXRd1PpH3a0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=HSEX14X0; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="HSEX14X0" Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PHUbPv006245; Tue, 25 Jun 2024 10:34:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=J YCVLA030JdTa4Etwmskuq3bLahLN/g/i7womYaVbAU=; b=HSEX14X0jQg2Hy3E3 NZs7GEPie1VtRpEDUbKu1QZvxHmM531udrHYN5iSKHZJNsD40M3o63f73XkzM/Ad l+kH5do1AVYuffG5CkWO0/WtTmQXIawDbnUxjU8o6YvxiyClSXFxBHGj2wVPcSqA liDbNoJbb7fdWZlhpQ/jGLAAuGyoc/RtiGw+YNcQqDfWpWf3XzF0EhWiJN0FcZoz DW1QeFiAPOyVa+d6Tfyzvx7ZpD0b6s2Um6uoCeIUeDNbUVSCtX+Mq+qW99w28KYJ Hwn2W+ncPomF08eOumtLTxUXb6XiHymdbE+vKFQDwQiak/1604wiKVW1yIRwGiLy oZ0NQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3yytt0a2wr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 10:34:26 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 25 Jun 2024 10:34:25 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 25 Jun 2024 10:34:25 -0700 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id 20BAB3F7063; Tue, 25 Jun 2024 10:34:20 -0700 (PDT) From: Suman Ghosh To: , , , , , , , , , , , , CC: Suman Ghosh Subject: [net PATCH v2 4/7] octeontx2-af: Fixes klockwork issues in rvu_cpt.c Date: Tue, 25 Jun 2024 23:03:47 +0530 Message-ID: <20240625173350.1181194-6-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240625173350.1181194-1-sumang@marvell.com> References: <20240625173350.1181194-1-sumang@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: Y4L1rctydehXCFjhzpcM4eOkIQIvenzj X-Proofpoint-GUID: Y4L1rctydehXCFjhzpcM4eOkIQIvenzj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-25_12,2024-06-25_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org Added initialization of a local variable to avoid junk values if it is used before set. Fixes: 4826090719d4 ("octeontx2-af: Enable CPT HW interrupts") Signed-off-by: Suman Ghosh --- drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c index f047185f38e0..a1a919fcda47 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c @@ -43,7 +43,7 @@ static irqreturn_t cpt_af_flt_intr_handler(int vec, void *ptr) struct rvu *rvu = block->rvu; int blkaddr = block->addr; u64 reg, val; - int i, eng; + int i, eng = 0; u8 grp; reg = rvu_read64(rvu, blkaddr, CPT_AF_FLTX_INT(vec)); From patchwork Tue Jun 25 17:33:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 13711746 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E69ED1448EA; Tue, 25 Jun 2024 17:34:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336881; cv=none; b=VLRHn1v15pR0KfD0p5IliBp8uFfcxepq4vPg7op4BiL1vTGIquryLENoMxqX/yWckIIJp4VTUuCMC+GG0Gu1WeiEfXsDwT8SW9iMNuNNC6B8nxN46qU0ZjkjFF1adc7MfWMwQ/S/B/WLFGZbOhIpPfu9grAB1U1JBfEKkoU5bn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336881; c=relaxed/simple; bh=mYswLskD2f54xsA+uigeWVHnVsphdKMidBwt5fV88iE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LGPigTCliyOZ9O6J+AHMcZ9GAHS2UeQsUMZ5hLT5Y+2locIDiuiiAMa2vxGBQNmc1B9VL7p2dIg4RRLr2bm3wsle/C45NJCSD2u5VxuE+BUTOOt1KZzGgzRSCKcM9djtvwU4YY7ny/vEOR/AIQ1vK6tqtpIzVA2rPo1KGYUQeoo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=EASIKClw; arc=none smtp.client-ip=67.231.156.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="EASIKClw" Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PBtIf9000832; Tue, 25 Jun 2024 10:34:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=D e0t3Fua8wPFIE995yUJ9ZMXzL8cJoYXVeTjct8zcQc=; b=EASIKClwTSbHSPYp/ 0GTGzMO+uwnxQLn4L1OXbGYG31COxg++kbo8ZcW2xjn9JbFuIrRc5kRQozh32kLb 4bPawvCaaI9KkECx4pgH4kc1JcGpDQjV1/H+GV+hhQOi4KLoDLwx8j5X4WYEby4l 9JKwMRctecw5j/c1Ny4qpLV+qmogk/00tKt06NgZc/mS2fDzBxmKo45B38j7eOpX eEJg9WI+KfrVR5UDUfeVLAznL+jnFOlTZ4956rbxoSK7IhINtcmEvm/xDkbGhGiS YTvtV5t5I5sQMfgjdzPewK0ah3yA8ZVwFlHpumfTSU+JFv2nMGRzTAC8uIbhGHgT KKTuQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3yywec9kjx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 10:34:33 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 25 Jun 2024 10:34:32 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 25 Jun 2024 10:34:32 -0700 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id 30E7B3F7063; Tue, 25 Jun 2024 10:34:27 -0700 (PDT) From: Suman Ghosh To: , , , , , , , , , , , , CC: Suman Ghosh Subject: [net PATCH v2 5/7] octeontx2-af: Fixes klockwork issues in rvu_debugfs.c Date: Tue, 25 Jun 2024 23:03:48 +0530 Message-ID: <20240625173350.1181194-7-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240625173350.1181194-1-sumang@marvell.com> References: <20240625173350.1181194-1-sumang@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: nWepujQj1fbK2-dvBfYR7qQm0nC5hsnW X-Proofpoint-GUID: nWepujQj1fbK2-dvBfYR7qQm0nC5hsnW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-25_12,2024-06-25_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org As part of this fix, fixed sized char array is converted to dynamic sized array to avoid splitting of some debug information. Fixes: d06c2aba5163 ("octeontx2-af: cn10k: mcs: Add debugfs support") Signed-off-by: Suman Ghosh --- drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c index 881d704644fb..292eead7be46 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c @@ -518,13 +518,17 @@ RVU_DEBUG_SEQ_FOPS(mcs_rx_secy_stats, mcs_rx_secy_stats_display, NULL); static void rvu_dbg_mcs_init(struct rvu *rvu) { + char *dname = NULL; struct mcs *mcs; - char dname[10]; int i; if (!rvu->mcs_blk_cnt) return; + dname = kmalloc_array(rvu->mcs_blk_cnt, sizeof(char), GFP_KERNEL); + if (!dname) + return; + rvu->rvu_dbg.mcs_root = debugfs_create_dir("mcs", rvu->rvu_dbg.root); for (i = 0; i < rvu->mcs_blk_cnt; i++) { @@ -568,6 +572,8 @@ static void rvu_dbg_mcs_init(struct rvu *rvu) debugfs_create_file("port", 0600, rvu->rvu_dbg.mcs_tx, mcs, &rvu_dbg_mcs_tx_port_stats_fops); } + + kfree(dname); } #define LMT_MAPTBL_ENTRY_SIZE 16 From patchwork Tue Jun 25 17:33:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 13711747 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32E8317D343; Tue, 25 Jun 2024 17:34:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336885; cv=none; b=VKDVUl3ZkiyKe/u4XgwN67Zzx3ymUBhMuS8he+epxiJ7BiFoN2R6ZUDZWelYT/0CHeI48m5owmyJUD9gZnta9tYeZKaCn9Jv8HaOFd8yKff17xleOd7vDEjoqSdj1iOxjHUokB62aVf8nkkYJKjc4JYUlhJTgdpjCWDMIci8CMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336885; c=relaxed/simple; bh=0cka1TXYMgRy2prVPvmLZJK3mOmAxfrX4QmsAG9GPJE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XP69VJ2ZFQB/1azQxWu4IfxF6rrbfXhgIUM817a5N5QrAV4AducoVdeAoPM+bVStuBfur1Q/x8+TF5z0FakFGuH5xit2362yjSvQiiU4RRpa9c009aPHug4a0SZCEIeWHBMfB4eaBNQJsyTSlO2oI1NIL4V/YrRwhwj49T8o9g0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=hv0U5f7f; arc=none smtp.client-ip=67.231.156.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="hv0U5f7f" Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PBtXHK001310; Tue, 25 Jun 2024 10:34:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=x EiosIJji1IppRdg/uaMeU0xRTn18yfKGcsicaSPU7U=; b=hv0U5f7fnX0pQEQ2V NGhV7ZWa10dLbEE8pti4BlF5sz9V8jzD2YB8myTGHQv0IqJXtLIilkadzLK4+trT J35gvk0rgkVCAGp31Hg/MP2p2CGhSak7hTyyN6a9jlkZLvLH/lKpsrzLZMFZ089Z Y7mPskG0RfG+c+uTsM9KsUxXUbnTf4dSS2tMuFtHa1i2EOMahajCKi/LlBY89/gb DH5DPxrfU7NhLdK84occUQTrc7kVBLUYDQ3StNc7H5EnBHM/2XkMWP9EVOes96yv 1c6OLF4AZ9bQ1dpVD2CZNsazD+DrowYLM7LjSX/HvPIpgpNAdPpTONAg1ZKQ7dYb jRrOA== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3yywec9kkc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 10:34:38 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 25 Jun 2024 10:34:38 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 25 Jun 2024 10:34:37 -0700 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id BF16B3F7063; Tue, 25 Jun 2024 10:34:33 -0700 (PDT) From: Suman Ghosh To: , , , , , , , , , , , , CC: Suman Ghosh Subject: [net PATCH v2 6/7] octeontx2-af: Fix klockwork issue in rvu_nix.c Date: Tue, 25 Jun 2024 23:03:49 +0530 Message-ID: <20240625173350.1181194-8-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240625173350.1181194-1-sumang@marvell.com> References: <20240625173350.1181194-1-sumang@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: -ElwGQc7q2JcoThwxd-Rg5g3VhbAhvl5 X-Proofpoint-GUID: -ElwGQc7q2JcoThwxd-Rg5g3VhbAhvl5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-25_12,2024-06-25_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org Added initialization of a local variable to avoid junk values if it is used before set. Fixes: 4b5a3ab17c6c ("octeontx2-af: Hardware configuration for inline IPsec") Signed-off-by: Suman Ghosh --- drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c index 00af8888e329..0c59295eaf9d 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -5375,7 +5375,7 @@ static void nix_inline_ipsec_cfg(struct rvu *rvu, struct nix_inline_ipsec_cfg *r int blkaddr) { u8 cpt_idx, cpt_blkaddr; - u64 val; + u64 val = 0; cpt_idx = (blkaddr == BLKADDR_NIX0) ? 0 : 1; if (req->enable) { From patchwork Tue Jun 25 17:33:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 13711748 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C865817838E; Tue, 25 Jun 2024 17:34:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336891; cv=none; b=HHOswfVvbN7C5Y2DsK5HIbUrqINBM4Q70rIpqcsorl+3rWsbfRMbe+QlvjnsYw3lgk1KUkblZognlw/IceXOiGHDFxK6eoGp8G4sjlmZjcxbUCcwNOdlAnArWAJcwg1PbWmT01GEBp45M+one0OdmxAzGxnFJd+k7l+syzKpDaA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719336891; c=relaxed/simple; bh=rXyeFlcUAQvcusm1isKCzLlJcBU8u/T8LnRE8Ytj0V0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GA6KYWNqS3G0KEW7ZAmRwaUWYwJxUiEC40368RsCZm4StfFfaB3LgZuOtOumtuXe7jAoS5QR/3iYKLlAOlv/ZYACUca+hNT23cSxZpyz1ECRNjU6QuMAEMJFsD9r2dKkorqyt74+b1WnzbwPc6mhYtXpQXhQNBcFTwI2s7U9KfA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=cUZKOmoj; arc=none smtp.client-ip=67.231.156.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="cUZKOmoj" Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PBssm7032688; Tue, 25 Jun 2024 10:34:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=+ OHJdafb26V/u9gjT72eS17RRGNSNRVIos+oqvZgfXA=; b=cUZKOmojYNggpY+HV EJO4I+hwNf3Itkzc7dPa1RwWNW5AGN9heuO5nZEe4RTxDljQZQjBD0dq2O21+7k1 wU8sZbBg6oVqD2s8KRU1JMVNHkEPrAfyQhmiHFpP2HoxiyERWYqoLhRdgE6Zi2yV VgV0tRtRyALvsxzOkqJ13zncM8IfkvVyhpVACEJQBxIiDwNo6M8dyoOOAQ32c6it qVPn7Myx7ZyY9kzWafqtzxJ8KG6952NoYQgNGwZ/PFL1YNRnSv/6x9Gay3L2i1/Y 7WPt7GJMWSWKSS0PuoLlJWN1nPBzjW6YLknQ4v6uGhko3Sq90jJK4gq5ycmjtGZy By4WA== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3yywec9kks-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 10:34:44 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 25 Jun 2024 10:34:43 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 25 Jun 2024 10:34:43 -0700 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id 576273F7063; Tue, 25 Jun 2024 10:34:39 -0700 (PDT) From: Suman Ghosh To: , , , , , , , , , , , , CC: Suman Ghosh Subject: [net PATCH v2 7/7] octeontx2-af: Fix klockwork issue in rvu_npc.c Date: Tue, 25 Jun 2024 23:03:50 +0530 Message-ID: <20240625173350.1181194-9-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240625173350.1181194-1-sumang@marvell.com> References: <20240625173350.1181194-1-sumang@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: pJVykOLgFoj5ue05hbXFEKA-BOIJOJU- X-Proofpoint-GUID: pJVykOLgFoj5ue05hbXFEKA-BOIJOJU- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-25_12,2024-06-25_01,2024-05-17_01 X-Patchwork-Delegate: kuba@kernel.org Set the pointer value to NULL after freeing to avoid wrong access. Fixes: 5d16250b6059 ("octeontx2-af: load NPC profile via firmware database") Signed-off-by: Suman Ghosh --- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index 97722ce8c4cb..a69438921a8e 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -1765,6 +1765,7 @@ static void npc_load_kpu_profile(struct rvu *rvu) rvu->kpu_prfl_addr = NULL; } else { kfree(rvu->kpu_fwdata); + rvu->kpu_fwdata = NULL; } rvu->kpu_fwdata = NULL; rvu->kpu_fwdata_sz = 0;