[PATCH 51/58] mtd: rawnand: mpc5121: retain chip state across removal

sashiko-bot at kernel.org sashiko-bot at kernel.org
Sat Nov 7 12:48:02 PST 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] mtd: rawnand: mpc5121: missing Fixes trailer for probe leak and
  removal UAF
--

commit 648cd21cc2eac3c4001033a11e9ac4de646c25b6
Author: James Hilliard <james.hilliard1 at gmail.com>

> mtd: rawnand: mpc5121: retain chip state across removal
>
> Drain NAND access before unmapping the external chip-select registers.
> Keep the embedded chip and controller alive until the final MTD
> reference, and unwind scanned NAND state on unsupported geometry and
> publication failure.
>
> Signed-off-by: James Hilliard <james.hilliard1 at gmail.com>

[Severity: Low]
This fixes a probe-time leak of nand_scan() allocations and a
use-after-free on device removal while MTD handles remain open, both
present since the driver was added.  Should it include a Fixes: tag?

  Fixes: bb315f749f8c ("mtd: nand: Add MPC5121 NAND Flash Controller driver")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261107-submit-rawnand-retained-handle-lifetime-v1-v1-0-0181ef0cc4c8@gmail.com?part=51



More information about the linux-mtd mailing list