[PATCH] mtd: rawnand: ndfc: fix I/O mapping leak on remove
Miquel Raynal
miquel.raynal at bootlin.com
Fri Sep 25 06:33:02 PDT 2026
On 16/09/2026 at 00:42:04 +08, Guangshuo Li <lgs201920130244 at gmail.com> 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 at vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244 at gmail.com>
No longer applies after Rosen Penev's patch, can you please rebase on top?
Thanks,
Miquèl
More information about the linux-mtd
mailing list