Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

octeontx2-af: fix the double free in rvu_npc_freemem()

Clang static checker(scan-build) warning:
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c:line 2184, column 2
Attempt to free released memory.

npc_mcam_rsrcs_deinit() has released 'mcam->counters.bmap'. Deleted this
redundant kfree() to fix this double free problem.

Fixes: dd7842878633 ("octeontx2-af: Add new devlink param to configure maximum usable NIX block LFs")
Signed-off-by: Su Hui <suhui@nfschina.com>
Reviewed-by: Geetha sowjanya <gakula@marvell.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Hariprasad Kelam <hkelam@marvell.com>
Link: https://lore.kernel.org/r/20240424022724.144587-1-suhui@nfschina.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Su Hui and committed by
Jakub Kicinski
6e965eba 1b9e743e

-1
-1
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
··· 2181 2181 2182 2182 kfree(pkind->rsrc.bmap); 2183 2183 npc_mcam_rsrcs_deinit(rvu); 2184 - kfree(mcam->counters.bmap); 2185 2184 if (rvu->kpu_prfl_addr) 2186 2185 iounmap(rvu->kpu_prfl_addr); 2187 2186 else