[PATCH] soc: microchip: mpfs-sys-controller: put the flash device reference
Conor Dooley
conor at kernel.org
Thu Nov 5 10:39:44 PST 2026
From: Conor Dooley <conor.dooley at microchip.com>
On Wed, 04 Nov 2026 02:14:35 +0000, Wentao Liang wrote:
> of_get_mtd_device_by_node() returns an mtd_info with a reference taken
> on the MTD device, which is stored in sys_controller->flash. The
> reference is never released, neither when the last sys_controller user
> goes away nor on the probe error path that frees a freshly allocated
> controller without initialising the kref.
>
> Balance it with put_mtd_device() in both places.
>
> [...]
Applied to riscv-soc-fixes, thanks!
[1/1] soc: microchip: mpfs-sys-controller: put the flash device reference
https://git.kernel.org/conor/c/6fdd47bf3736
Thanks,
Conor.
More information about the linux-riscv
mailing list