[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240624103638.2087821-6-sumang@marvell.com>
Date: Mon, 24 Jun 2024 16:06:36 +0530
From: Suman Ghosh <sumang@...vell.com>
To: <sgoutham@...vell.com>, <gakula@...vell.com>, <sbhatta@...vell.com>,
<hkelam@...vell.com>, <davem@...emloft.net>, <edumazet@...gle.com>,
<kuba@...nel.org>, <pabeni@...hat.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <lcherian@...vell.com>,
<jerinj@...vell.com>, <markus.elfring@....de>
CC: Suman Ghosh <sumang@...vell.com>
Subject: [net PATCH 5/7] octeontx2-af: Fixes klockwork issues in rvu_debugfs.c
These are not real issues but sanity checks.
Fixes: d06c2aba5163 ("octeontx2-af: cn10k: mcs: Add debugfs support")
Signed-off-by: Suman Ghosh <sumang@...vell.com>
---
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
--
2.25.1
Powered by blists - more mailing lists