All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Fourier <fourier.thomas@gmail.com>
Cc: Thomas Fourier <fourier.thomas@gmail.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Kees Cook <kees@kernel.org>,
	Manuel Lauss <manuel.lauss@googlemail.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	linux-mtd@lists.infradead.org (open list:NAND FLASH SUBSYSTEM),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] MTD: nand: Fix release_mem_region() size
Date: Wed, 14 Oct 2026 10:22:51 +0200	[thread overview]
Message-ID: <20261014082258.33315-2-fourier.thomas@gmail.com> (raw)

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@gmail.com>
---
 drivers/mtd/nand/raw/au1550nd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/au1550nd.c b/drivers/mtd/nand/raw/au1550nd.c
index f1e99197ab84..623a10dbce55 100644
--- a/drivers/mtd/nand/raw/au1550nd.c
+++ b/drivers/mtd/nand/raw/au1550nd.c
@@ -348,7 +348,7 @@ static void au1550nd_remove(struct platform_device *pdev)
 	WARN_ON(ret);
 	nand_cleanup(chip);
 	iounmap(ctx->base);
-	release_mem_region(r->start, 0x1000);
+	release_mem_region(r->start, resource_size(r));
 	kfree(ctx);
 }
 
-- 
2.53.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

             reply	other threads:[~2026-10-14  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14  8:22 Thomas Fourier [this message]
2026-10-14  9:23 ` [PATCH] MTD: nand: Fix release_mem_region() size Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261014082258.33315-2-fourier.thomas@gmail.com \
    --to=fourier.thomas@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=manuel.lauss@googlemail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.