Re: [PATCH] mtd: mtdpart: fix uninitialized erasesize on MTDPART_OFS_RETAIN error path

From: Miquel Raynal

Date: Mon Jun 29 2026 - 11:06:07 EST


On Sat, 20 Jun 2026 20:06:03 +0300, Nikolay Ivchenko wrote:
> When parsing partition layouts, if a partition requested with
> MTDPART_OFS_RETAIN runs out of space, the allocator jumps directly
> to 'out_register' to preserve partition numbering.
>
> However, this jump bypasses child->erasesize initialization, leaving
> it at zero. When add_mtd_device() is later called on this child, the
> registration fails and triggers a WARN_ON() due to the zero ->erasesize.
>
> [...]

Applied to mtd/fixes, thanks!

[1/1] mtd: mtdpart: fix uninitialized erasesize on MTDPART_OFS_RETAIN error path
commit: ae9d8058f13238cad5f5d16f676da91187684581

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