[PATCH] MTD: nand: Fix release_mem_region() size

Miquel Raynal miquel.raynal at bootlin.com
Wed Oct 14 02:23:13 PDT 2026


Hi Thomas,

> In au1550nd_probe(), request_mem_region() is called with size
> resource_size(r), and release_mem_region() is called in the error path
> with the same size. Howeve, in the cleanup function au1550nd_remove()
> calls release_mem_region() with size 0x1000.
>
> Change release size to match request.
>
> Fixes: b67a1a02d463 ("MTD: nand: make au1550nd.c a platform_driver")
> Signed-off-by: Thomas Fourier <fourier.thomas at gmail.com>
> ---

This driver is very old. If you care about cleaning it up, I would
suggest doing something bigger. For instance platform_get_resource,
request_mem_region and ioremap are now a single helper named
devm_platform_ioremap_resource(). The kzalloc could also become device
managed. This will further reduce the size of the error path and the
removal.

The subject prefix btw should be updated to match today's standards (see
git log --oneline -- drivers/mtd/nand/raw/).

Do you own the hardware?

Thanks,
Miquèl



More information about the linux-mtd mailing list