Re: [PATCH v2] mtd: retain the partition node reference across device registration

From: Miquel Raynal

Date: Fri Dec 04 2026 - 16:50:11 EST


On Sun, 08 Nov 2026 15:48:16 -0700, James Hilliard wrote:
> 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.
>
> [...]

Applied to mtd/next, thanks!

[1/1] mtd: retain the partition node reference across device registration
commit: 3b872ebc2939d5d30ef9296b1ca7c449f9b77bea

Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).

Kind regards,
Miquèl