On 2026-01-07 13:22, Petr Pavlu wrote:
> In the error path of load_module(), under the free_module label, the
> code calls lockdep_free_key_range() to release lock classes associated
> with the MOD_DATA, MOD_RODATA and MOD_RO_AFTER_INIT module regions, and
> subsequently invokes module_deallocate().
> 
> Since commit ac3b43283923 ("module: replace module_layout with
> module_memory"), the module_deallocate() function calls free_mod_mem(),
> which releases the lock classes as well and considers all module
> regions.
> 
> Attempting to free these classes twice is unnecessary. Remove the
> redundant code in load_module().

I'd even say module_deallocate() handles MOD_DATA properly (deferring
it to the last one) while the first loop was not taking that into
consideration.

> 
> Signed-off-by: Petr Pavlu <[email protected]>

Reviewed-by: Daniel Gomez <[email protected]>


Reply via email to