Re: [PATCH] mtd: part: reject MTDPART_OFS_RETAIN in mtd_add_partition()

Miquel Raynal <[email protected]>
Newsgroups org.infradead.lists.linux-mtd,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Thu, 16 Jul 2026 21:14:32 +0800, zhouminqiang wrote:
> mtd_add_partition() does not reject the special offset value
> MTDPART_OFS_RETAIN (-3), which leads to a WARN_ON in
> add_mtd_device() when called through the BLKPG ioctl on NAND
> devices. The RETAIN value depends on cur_offset being the end of
> the previous partition, but in the dynamic partition path
> cur_offset equals the offset argument itself, causing undefined
> behavior.
> 
> [...]

Applied to mtd/next, thanks!

[1/1] mtd: part: reject MTDPART_OFS_RETAIN in mtd_add_partition()
      commit: b759d5bb6265419344ee9729fd0dc07ad85719d8

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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.