[Devel] [PATCH hci-8.2 5/6] ms/klp-build: Fix wrong index in funcs cleanup error path

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Tue Dec 1 03:44:25 MSK 2026


> From: Yafang Shao <laoar.shao at gmail.com>
> 
> 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: 59adee07b568 ("livepatch/klp-build: Add stub init code for livepatch modules")
> Signed-off-by: Yafang Shao <laoar.shao at gmail.com>
> Acked-by: Song Liu <song at kernel.org>
> Reviewed-by: Petr Mladek <pmladek at suse.com>
> Acked-by: Miroslav Benes <mbenes at suse.cz>
> Link: https://patch.msgid.link/20260816090442.18128-2-laoar.shao@gmail.com
> Signed-off-by: Josh Poimboeuf <jpoimboe at kernel.org>
> (cherry picked from commit 4825ef699cda4c6f2f0586b17a5e225560481da6)
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-157128
> Feature: klp-build support
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261126-khorenko-vstor-157128-more-klp-build-fixes-v1-0-69a0363954e4@virtuozzo.com?part=5




More information about the Devel mailing list