[PATCH] soc: microchip: mpfs: Fix memory leak in mpfs_sys_controller_probe()

Conor Dooley conor at kernel.org
Thu Jan 15 11:17:02 PST 2026


From: Conor Dooley <conor.dooley at microchip.com>

On Sun, 28 Dec 2025 12:48:36 +0000, Zilin Guan wrote:
> In mpfs_sys_controller_probe(), if of_get_mtd_device_by_node() fails,
> the function returns immediately without freeing the allocated memory
> for sys_controller, leading to a memory leak.
> 
> Fix this by jumping to the out_free label to ensure the memory is
> properly freed.
> 
> [...]

Applied to riscv-soc-fixes, thanks!

[1/1] soc: microchip: mpfs: Fix memory leak in mpfs_sys_controller_probe()
      https://git.kernel.org/conor/c/5a741f8cc6fe

Thanks,
Conor.



More information about the linux-riscv mailing list