From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Ruoyu Wang <ruoyuw560@gmail.com>
Cc: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: slram: avoid dangling device list entries
Date: Tue, 09 Jun 2026 09:56:04 +0200 [thread overview]
Message-ID: <87h5ncb10r.fsf@bootlin.com> (raw)
In-Reply-To: <20260608162939.6-1-ruoyuw560@gmail.com> (Ruoyu Wang's message of "Tue, 9 Jun 2026 00:29:39 +0800")
Hello Ruoyu,
On 09/06/2026 at 00:29:39 +08, Ruoyu Wang <ruoyuw560@gmail.com> wrote:
> register_device() links a new slram_mtdlist entry before the entry is
> fully initialized. If a later allocation, memremap(), or
> mtd_device_register() fails, the failed entry can remain reachable from
> the global list and later cleanup can dereference or free invalid state.
>
> Build the new entry off-list, unwind partial initialization locally on
> failure, and only publish the entry after mtd_device_register()
> succeeds.
>
> Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
I am sorry but I cannot take this patch as-is because it does way more
than what you claim. It makes a lot of cleanup changes which are totally
unrelated (yet welcome). Please create a series with:
- the fix (that can be backported) first, with Cc: stable and Fixes: tags
- all the cleanups you want to do after.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Ruoyu Wang <ruoyuw560@gmail.com>
Cc: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: slram: avoid dangling device list entries
Date: Tue, 09 Jun 2026 09:56:04 +0200 [thread overview]
Message-ID: <87h5ncb10r.fsf@bootlin.com> (raw)
In-Reply-To: <20260608162939.6-1-ruoyuw560@gmail.com> (Ruoyu Wang's message of "Tue, 9 Jun 2026 00:29:39 +0800")
Hello Ruoyu,
On 09/06/2026 at 00:29:39 +08, Ruoyu Wang <ruoyuw560@gmail.com> wrote:
> register_device() links a new slram_mtdlist entry before the entry is
> fully initialized. If a later allocation, memremap(), or
> mtd_device_register() fails, the failed entry can remain reachable from
> the global list and later cleanup can dereference or free invalid state.
>
> Build the new entry off-list, unwind partial initialization locally on
> failure, and only publish the entry after mtd_device_register()
> succeeds.
>
> Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
I am sorry but I cannot take this patch as-is because it does way more
than what you claim. It makes a lot of cleanup changes which are totally
unrelated (yet welcome). Please create a series with:
- the fix (that can be backported) first, with Cc: stable and Fixes: tags
- all the cleanups you want to do after.
Thanks,
Miquèl
next prev parent reply other threads:[~2026-06-09 7:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 16:29 [PATCH] mtd: slram: avoid dangling device list entries Ruoyu Wang
2026-06-08 16:29 ` Ruoyu Wang
2026-06-09 7:56 ` Miquel Raynal [this message]
2026-06-09 7:56 ` 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=87h5ncb10r.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
--cc=ruoyuw560@gmail.com \
--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.