Re: [PATCH v2] riscv: Check the return value of reloc handlers

From: Paul Walmsley

Date: Thu May 21 2026 - 18:46:28 EST


Hi,

On Sat, 9 May 2026, Zishun Yi wrote:

> Currently, process_accumulated_relocations() ignores the return values
> from both reloc_handler() and accumulate_handler().
>
> As a result, the kernel will proceed to load the module with corrupted
> or incomplete sections, which can lead to unpredictable behavior or
> kernel panics.
>
> So we need to check the return values of the handlers to propagate the
> error, and fall back to the cleanup mode.

Thanks for the patch. Rather than continuing to loop without purpose when
an error occurs, can the function simply be exited?


- Paul