Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43ccce02 authored by Tatyana Brokhman's avatar Tatyana Brokhman
Browse files

mtd: msm_qpic_nand: Support for multi page read - fix



retlen variable was not initialized.
Fix data conversion.

CRs-fixed: 619895
Change-Id: I699c19c3661acfb40dae0be8a7caec9e480828dc
Signed-off-by: default avatarTatyana Brokhman <tlinder@codeaurora.org>
parent c1292ee1
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1838,6 +1838,7 @@ static int msm_nand_read(struct mtd_info *mtd, loff_t from, size_t len,
	ops.retlen = 0;
	ops.ooblen = 0;
	ops.oobbuf = NULL;
	*retlen = 0;

	if (!(from & (mtd->writesize - 1)) && !(len % mtd->writesize)) {
		/*
@@ -1849,7 +1850,7 @@ static int msm_nand_read(struct mtd_info *mtd, loff_t from, size_t len,
			ops.len = mtd->writesize;

			for (;;) {
				ops.datbuf = buf;
				ops.datbuf = (uint8_t *)buf;
				ret = msm_nand_read_oob(mtd, from, &ops);
				if (ret < 0)
					break;
@@ -1872,13 +1873,13 @@ static int msm_nand_read(struct mtd_info *mtd, loff_t from, size_t len,
			}
		} else {
			ops.len = len;
			ops.datbuf = buf;
			ops.datbuf = (uint8_t *)buf;
			ret =  msm_nand_read_oob(mtd, from, &ops);
			*retlen = ops.retlen;
		}
	} else {
		ops.len = len;
		ops.datbuf = buf;
		ops.datbuf = (uint8_t *)buf;
		ret = msm_nand_read_partial_page(mtd, from, &ops);
		*retlen = ops.retlen;
	}