From: sashiko-bot@kernel.org
To: "James Hilliard" <james.hilliard1@gmail.com>,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
"Richard Weinberger" <richard@nod.at>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
"Christian Marangi" <ansuelsmth@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: retain the partition node reference across device registration
Date: Sun, 08 Nov 2026 21:17:29 +0000 [thread overview]
Message-ID: <sashiko-outbox-204070@kernel.org> (raw)
In-Reply-To: <20261108-submit-mtd-partition-node-reference-v1-v1-1-ad30359569d4@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] mtd: incorrect Fixes trailer commit in mtd_find_of_node() change
--
commit 43323e99a46a84cff0195c53099ca6a7a7215432
Author: James Hilliard <james.hilliard1@gmail.com>
> mtd: retain the partition node reference across device registration
>
> mtd_check_of_node() obtains a child node reference while looking up a
> partition, stores the node in the MTD device, and drops the reference.
> add_mtd_device() only takes its own reference after the helper returns.
> A concurrent dynamic DT removal can release the node in that gap.
>
> Return a referenced node from the lookup helper and transfer that reference
> to the MTD device. For an already supplied node, acquire the reference in
> the same helper. The existing registration unwind and device release paths
> remain responsible for putting it.
>
> Fixes: ad9b10d1eaad ("mtd: core: introduce of support for dynamic partitions")
> Cc: stable@vger.kernel.org
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[Severity: Low]
Should the Fixes: tag point to 5ab9bbf6c678 ("mtd: Fix possible refcounting
issue when going through partition nodes") instead?
Commit ad9b10d1eaad ("mtd: core: introduce of support for dynamic
partitions") broke out of for_each_child_of_node() without calling
of_node_put(mtd_dn), keeping the reference held across the return to
add_mtd_device(). Commit 5ab9bbf6c678 ("mtd: Fix possible refcounting issue
when going through partition nodes") added the of_node_put(mtd_dn) call in
mtd_check_of_node(), creating the window where the reference is dropped
before add_mtd_device() calls of_node_get().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261108-submit-mtd-partition-node-reference-v1-v1-1-ad30359569d4@gmail.com?part=1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2026-11-08 21:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 21:10 [PATCH] mtd: retain the partition node reference across device registration James Hilliard
2026-11-08 21:10 ` James Hilliard
2026-11-08 21:17 ` sashiko-bot [this message]
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=sashiko-outbox-204070@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ansuelsmth@gmail.com \
--cc=james.hilliard1@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=sashiko-reviews@lists.linux.dev \
--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.