Commit 6e965eba authored by Su Hui's avatar Su Hui Committed by Jakub Kicinski

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: dd784287 ("octeontx2-af: Add new devlink param to configure maximum usable NIX block LFs")
Signed-off-by: default avatarSu Hui <suhui@nfschina.com>
Reviewed-by: default avatarGeetha sowjanya <gakula@marvell.com>
Reviewed-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: default avatarHariprasad Kelam <hkelam@marvell.com>
Link: https://lore.kernel.org/r/20240424022724.144587-1-suhui@nfschina.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1b9e743e
...@@ -2181,7 +2181,6 @@ void rvu_npc_freemem(struct rvu *rvu) ...@@ -2181,7 +2181,6 @@ void rvu_npc_freemem(struct rvu *rvu)
kfree(pkind->rsrc.bmap); kfree(pkind->rsrc.bmap);
npc_mcam_rsrcs_deinit(rvu); npc_mcam_rsrcs_deinit(rvu);
kfree(mcam->counters.bmap);
if (rvu->kpu_prfl_addr) if (rvu->kpu_prfl_addr)
iounmap(rvu->kpu_prfl_addr); iounmap(rvu->kpu_prfl_addr);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment