Re: [PATCH v2] riscv: Fix memory leak in apply_relocate_add

From: Paul Walmsley

Date: Wed Nov 25 2026 - 21:23:20 EST


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