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

From: Ruoyu Wang

Date: Tue Jun 09 2026 - 04:58:52 EST


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@xxxxxxxxx/

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