[PATCH v2 0/2] mtd: slram: fix failed registration cleanup

Ruoyu Wang ruoyuw560 at gmail.com
Tue Jun 9 01:45:26 PDT 2026


This splits the previous slram patch into a backportable fix and a
follow-up cleanup.

Patch 1 fixes the dangling list entry on register_device() failure and
carries Fixes and stable tags.

Patch 2 is a cleanup which uses local variables while initializing the
new entry and publishes the list entry only after mtd_device_register()
succeeds.

Changes in v2:
- Split the original patch into a fix first and a cleanup second.
- Add Fixes and Cc: stable tags to the fix.
- Link to v1: https://lore.kernel.org/all/20260608162939.6-1-ruoyuw560@gmail.com/

Ruoyu Wang (2):
  mtd: slram: remove failed entries from the device list
  mtd: slram: simplify register_device() cleanup

 drivers/mtd/devices/slram.c | 96 ++++++++++++++++++++-----------------
 1 file changed, 52 insertions(+), 44 deletions(-)

-- 
2.51.0



More information about the linux-mtd mailing list