mtd: spinand: initialize ret in regular page reads

spinand_mtd_regular_page_read() returns ret after iterating over the
requested pages. If the request contains no data or OOB bytes, the
iterator does not run and ret is not assigned. Initialize it to 0 for the
empty request path.

Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
Ruoyu Wang 2026-06-18 02:37:49 +08:00 committed by Miquel Raynal
parent 4b45d7836b
commit 5d7a08125e

View File

@ -822,7 +822,7 @@ static int spinand_mtd_regular_page_read(struct mtd_info *mtd, loff_t from,
bool disable_ecc = false;
bool ecc_failed = false;
unsigned int retry_mode = 0;
int ret;
int ret = 0;
old_stats = mtd->ecc_stats;