linux/scripts/livepatch
Yafang Shao 4825ef699c klp-build: Fix wrong index in funcs cleanup error path
In the object allocation loop, when kzalloc() for funcs fails, the
cleanup loop uses `objs[i].funcs` instead of `objs[j].funcs`. Since
`objs[i].funcs` is still NULL at that point, it repeatedly calls
kfree(NULL) and leaks all previously allocated funcs arrays.

Fixes: 59adee07b5 ("livepatch/klp-build: Add stub init code for livepatch modules")
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Acked-by: Song Liu <song@kernel.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Link: https://patch.msgid.link/20260816090442.18128-2-laoar.shao@gmail.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
2026-08-31 17:50:06 -07:00
..
fix-patch-lines livepatch/klp-build: Introduce klp-build script for generating livepatch modules 2025-10-14 14:50:19 -07:00
init.c klp-build: Fix wrong index in funcs cleanup error path 2026-08-31 17:50:06 -07:00
klp-build objtool/klp: Fix symbol resolution for duplicate data symbols 2026-08-03 07:12:39 +02:00
Makefile livepatch/klp-build: add Makefile with check target 2026-03-16 12:46:48 -07:00