Re: [PATCH] mtdchar: initialize MEMREAD statistics before each read

From: Miquel Raynal

Date: Fri Nov 20 2026 - 10:08:52 EST


On Fri, 06 Nov 2026 21:31:18 -0700, James Hilliard wrote:
> mtd_read_oob() can reject an invalid OOB range before initializing
> ops->stats. mtdchar_read_ioctl() nevertheless accumulates the per-read
> statistics before checking the return code and copies the accumulated
> values back to userspace, even when the ioctl returns an error.
>
> Initialize the local statistics on every loop iteration so a rejected
> read contributes zero counters and preserves statistics from any earlier
> completed reads.
>
> [...]

Applied to mtd/next, thanks!

[1/1] mtdchar: initialize MEMREAD statistics before each read
commit: b3b86fbd14b98c6a1786308ba0ecd666827dcb0e

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