Netdev List
 help / color / mirror / Atom feed
* [PATCH net] octeontx2-af: Fix initialization of mcam's entry2target_pffunc field
@ 2026-05-29 11:37 Subbaraya Sundeep
  2026-06-03 18:32 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Subbaraya Sundeep @ 2026-05-29 11:37 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, sgoutham, gakula,
	bbhushan2
  Cc: netdev, linux-kernel, Suman Ghosh, Subbaraya Sundeep

From: Suman Ghosh <sumang@marvell.com>

NPC mcam entry stores a mapping between mcam entry and target pcifunc.
During initialization of this field, API kmalloc_array has been used which
caused some junk values to array. Whereas, the array is expected to be
initialized by 0. This patch fixes the same by using kcalloc instead of
kmalloc_array.

Fixes: 55307fcb9258 ("octeontx2-af: Add mbox messages to install and delete MCAM rules")
Signed-off-by: Suman Ghosh <sumang@marvell.com>
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index 607d0cf1a778..6bbda0593fcd 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -2192,8 +2192,8 @@ int npc_mcam_rsrcs_init(struct rvu *rvu, int blkaddr)
 		goto free_entry_cntr_map;
 
 	/* Alloc memory for saving target device of mcam rule */
-	mcam->entry2target_pffunc = kmalloc_array(mcam->total_entries,
-						  sizeof(u16), GFP_KERNEL);
+	mcam->entry2target_pffunc = kcalloc(mcam->total_entries,
+					    sizeof(u16), GFP_KERNEL);
 	if (!mcam->entry2target_pffunc)
 		goto free_cntr_refcnt;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] octeontx2-af: Fix initialization of mcam's entry2target_pffunc field
  2026-05-29 11:37 [PATCH net] octeontx2-af: Fix initialization of mcam's entry2target_pffunc field Subbaraya Sundeep
@ 2026-06-03 18:32 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2026-06-03 18:32 UTC (permalink / raw)
  To: Subbaraya Sundeep
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, sgoutham, gakula,
	bbhushan2, netdev, linux-kernel, Suman Ghosh

On Fri, May 29, 2026 at 05:07:05PM +0530, Subbaraya Sundeep wrote:
> From: Suman Ghosh <sumang@marvell.com>
> 
> NPC mcam entry stores a mapping between mcam entry and target pcifunc.
> During initialization of this field, API kmalloc_array has been used which
> caused some junk values to array. Whereas, the array is expected to be
> initialized by 0. This patch fixes the same by using kcalloc instead of
> kmalloc_array.
> 
> Fixes: 55307fcb9258 ("octeontx2-af: Add mbox messages to install and delete MCAM rules")
> Signed-off-by: Suman Ghosh <sumang@marvell.com>
> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>

Reviewed-by: Simon Horman <horms@kernel.org>

FTR, there is an AI-generated review of this patch available on sashiko.dev.
However, I believe that the issue raised there can be treated in the
context of possible follow-up and should not delay the progress of this
patch.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-03 18:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-29 11:37 [PATCH net] octeontx2-af: Fix initialization of mcam's entry2target_pffunc field Subbaraya Sundeep
2026-06-03 18:32 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox