[PATCH v4 3/4] MIPS: Octeon: flash: allocate the map per device
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Tue Nov 17 13:50:06 PST 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] MIPS: Octeon: missing Fixes trailer for octeon_flash_probe()
static map bug
--
commit be5173a34aecc571a39f6355a5088e09f2d61146
Author: Orgad Shaneh <orgads at gmail.com>
> MIPS: Octeon: flash: allocate the map per device
>
> octeon_flash_probe() fills in one static map_info for every "cfi-flash"
> node it binds to, so a second chip select overwrites the phys, virt,
> size and bank width of the first while that MTD device still uses the
> map. A probe whose do_map_probe() finds no chip also keeps its
> ioremap() mapping and still returns success.
>
> Allocate the map with devm_kzalloc(), map it with devm_ioremap() and
> fail the probe when no chip is found or the partitions cannot be
> registered, so the mapping goes away with the device. mymtd was never
> read; drop it.
>
> The driver has no remove(), and the mapping is now device-managed: a
> sysfs unbind would unmap the flash while its MTD device stays
> registered. Set suppress_bind_attrs to rule that out.
>
> Signed-off-by: Orgad Shaneh <orgads at gmail.com>
[Severity: Low]
This fixes the static flash_map overwrite and probe error handling in
octeon_flash_probe(). Should it include:
Fixes: 7f481716bc90 ("MIPS: OCTEON: Use device tree to probe for flash chips.")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261117214141.3826637-1-orgads@gmail.com?part=3
More information about the linux-mtd
mailing list