On Wed 2026-07-01 14:06:55, Shihao Ren wrote:
> In the funcs allocation failure path, the cleanup loop iterates with
> 'j' but frees objs[i].funcs, which uses the outer loop index 'i'
> instead of the loop variable 'j'. As a result the just-failed (NULL)
> entry is freed repeatedly, while the funcs buffers already allocated
> for objs[0..i-1] are leaked.
>
> Use objs[j].funcs so the previously allocated entries are correctly
> released.
>
> Fixes: 59adee07b568 ("livepatch/klp-build: Add stub init code for livepatch
> modules")
> Signed-off-by: Shihao Ren <[email protected]>
Great catch!
Reviewed-by: Petr Mladek <[email protected]>
I assume that Josh would take this together with other klp-build
related changes.
Best Regards,
Petr