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

Miquel Raynal miquel.raynal at bootlin.com
Fri Jul 17 08:50:42 PDT 2026


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




More information about the linux-mtd mailing list