]> exis.tech > repos - linux.git/commit
octeontx2-af: fix memory leak in rvu_setup_hw_resources()
authorDawei Feng <dawei.feng@seu.edu.cn>
Thu, 4 Jun 2026 14:37:56 +0000 (22:37 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 9 Jun 2026 10:30:41 +0000 (12:30 +0200)
commit09a5bf856aa759513afc4afd233d15bcc711b84e
tree84ad7159664bb8d9825cf9fe802495045a9a678e
parent333b6d5bb9f87827ac2639c737bf9613dbae7253
octeontx2-af: fix memory leak in rvu_setup_hw_resources()

If rvu_npc_exact_init() fails in rvu_setup_hw_resources(), the function
returns directly instead of jumping to the error handling path. This
causes a resource leak for the previously initialized CGX, NPC, fwdata,
and MSI-X states.

Fix this by replacing the direct return with goto cgx_err to ensure
proper cleanup.

The bug was first flagged by an experimental analysis tool we are
developing for kernel memory-management bugs while analyzing
v6.13-rc1. The tool is still under development and is not yet publicly
available. Manual inspection confirms that the bug is still present in
v7.1-rc6.

An x86_64 allyesconfig build showed no new warnings. As we do not have
access to Marvell OcteonTX2 RVU AF hardware to test with, no runtime
testing was able to be performed.

Fixes: 3571fe07a090 ("octeontx2-af: Drop rules for NPC MCAM")
Cc: stable@vger.kernel.org
Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Link: https://patch.msgid.link/20260604143756.1524482-1-dawei.feng@seu.edu.cn
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/af/rvu.c