[PATCH] mtd: intel-dg: Fix accessing regions before setting nregions
Miquel Raynal
miquel.raynal at bootlin.com
Mon Jan 19 02:49:38 PST 2026
On Thu, 15 Jan 2026 07:22:37 +0200, Alexander Usyskin wrote:
> The regions array is counted by nregions, but it's set only after
> accessing it:
>
> [] UBSAN: array-index-out-of-bounds in drivers/mtd/devices/mtd_intel_dg.c:750:15
> [] index 0 is out of range for type '<unknown> [*]'
>
> Fix it by also fixing an undesired behavior: the loop silently ignores
> ENOMEM and continues setting the other entries.
>
> [...]
Applied to mtd/next, thanks!
[1/1] mtd: intel-dg: Fix accessing regions before setting nregions
commit: 779c59274d03cc5c07237a2c845dfb71cff77705
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