Re: [PATCH] mtd: mtdswap: Avoid freeing registered blktrans device twice

From: Miquel Raynal

Date: Fri Jul 17 2026 - 11:51:08 EST


On Wed, 08 Jul 2026 22:33:55 +0800, Ruoyu Wang wrote:
> In mtdswap_add_mtd(), debugfs setup failure after successful blktrans
> registration can free mbd_dev twice.
>
> add_mtd_blktrans_dev() initializes the blktrans device reference and
> publishes the disk. Once that succeeds, del_mtd_blktrans_dev() tears the
> disk down and drops the blktrans reference; when that reference reaches
> zero, blktrans_dev_release() frees the mtd_blktrans_dev.
>
> [...]

Applied to mtd/next, thanks!

[1/1] mtd: mtdswap: Avoid freeing registered blktrans device twice
commit: 779aa4c66a96bf43d2d62982ea1a9096a9128d87

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