[PATCH] riscv: Fix memory leak in module_frob_arch_sections()
patchwork-bot+linux-riscv at kernel.org
patchwork-bot+linux-riscv at kernel.org
Mon Oct 27 17:51:19 PDT 2025
Hello:
This patch was applied to riscv/linux.git (fixes)
by Paul Walmsley <pjw at kernel.org>:
On Sun, 26 Oct 2025 17:19:08 +0800 you wrote:
> The current code directly overwrites the scratch pointer with the
> return value of kvrealloc(). If kvrealloc() fails and returns NULL,
> the original buffer becomes unreachable, causing a memory leak.
>
> Fix this by using a temporary variable to store kvrealloc()'s return
> value and only update the scratch pointer on success.
>
> [...]
Here is the summary with links:
- riscv: Fix memory leak in module_frob_arch_sections()
https://git.kernel.org/riscv/c/c42458fcf54b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
More information about the linux-riscv
mailing list