]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sfc: fix potential memory leak in efx_mae_process_mport()
authorAbdun Nihaal <nihaal@cse.iitm.ac.in>
Thu, 23 Oct 2025 14:18:42 +0000 (19:48 +0530)
committerJakub Kicinski <kuba@kernel.org>
Tue, 28 Oct 2025 00:55:41 +0000 (17:55 -0700)
commit46a499aaf8c27476fd05e800f3e947bfd71aa724
treedbd1050a848a3413fa0a30efc38693f11773c85f
parent03ca7c8c42be913529eb9f188278114430c6abbd
sfc: fix potential memory leak in efx_mae_process_mport()

In efx_mae_enumerate_mports(), memory allocated for mae_mport_desc is
passed as a argument to efx_mae_process_mport(), but when the error path
in efx_mae_process_mport() gets executed, the memory allocated for desc
gets leaked.

Fix that by freeing the memory allocation before returning error.

Fixes: a6a15aca4207 ("sfc: enumerate mports in ef100")
Acked-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Link: https://patch.msgid.link/20251023141844.25847-1-nihaal@cse.iitm.ac.in
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/sfc/mae.c