Re: [PATCH] mtd: rawnand: ndfc: fix I/O mapping leak on remove
From: Miquel Raynal
Date: Fri Sep 25 2026 - 09:33:21 EST
On 16/09/2026 at 00:42:04 +08, Guangshuo Li <lgs201920130244@xxxxxxxxx> wrote:
> ndfc_probe() maps the controller registers with of_iomap(), but the
> remove path does not call the matching iounmap() before the driver is
> removed.
>
> If ndfc_chip_init() fails, the probe error path correctly unmaps
> ndfc->ndfcbase. However, after a successful probe, the mapping remains
> active for the lifetime of the device and ndfc_remove() never releases
> it, leaking the I/O mapping on driver unbind.
>
> Call iounmap() in ndfc_remove() after the NAND device cleanup to release
> the controller register mapping.
>
> This issue was found by manual code inspection.
>
> Fixes: a808ad3b0d28 ("[MTD] [NAND] ndfc driver")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Guangshuo Li <lgs201920130244@xxxxxxxxx>
No longer applies after Rosen Penev's patch, can you please rebase on top?
Thanks,
Miquèl