[PATCH v2] riscv: Fix memory leak in apply_relocate_add
Paul Walmsley
pjw at kernel.org
Wed Nov 25 18:23:06 PST 2026
On Sat, 9 May 2026, Zishun Yi wrote:
> The error path in apply_relocate_add() forgets to clean up the hashtable
> allocated at the beginning. But we should not use
> process_accumulated_relocations() as a cleanup function because some
> entries may be half-finished, and we cannot write incorrect values back
> to memory.
>
> So, add cleanup_accumulated_relocations() for freeing all memory
> allocated in the error paths.
Thanks, queued for v7.5.
- Paul
More information about the linux-riscv
mailing list