aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Nyekjaer <[email protected]>2020-12-21 11:00:13 +0100
committerMiquel Raynal <[email protected]>2021-01-04 12:08:32 +0100
commit4883a60c17eda6bf52d1c817ee7ead65b4a02da2 (patch)
tree9c638591a95c6b5ba3514cd9ab869df355def902
parent5c8fe583cce542aa0b84adc939ce85293de36e5e (diff)
mtd: rawnand: gpmi: fix dst bit offset when extracting raw payload
Re-add the multiply by 8 to "step * eccsize" to correct the destination bit offset when extracting the data payload in gpmi_ecc_read_page_raw(). Fixes: e5e5631cc889 ("mtd: rawnand: gpmi: Use nand_extract_bits()") Cc: [email protected] Reported-by: Martin Hundebøll <[email protected]> Signed-off-by: Sean Nyekjaer <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
-rw-r--r--drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index 5cdf05bcbf8f..3fa8c22d3f36 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -1615,7 +1615,7 @@ static int gpmi_ecc_read_page_raw(struct nand_chip *chip, uint8_t *buf,
/* Extract interleaved payload data and ECC bits */
for (step = 0; step < nfc_geo->ecc_chunk_count; step++) {
if (buf)
- nand_extract_bits(buf, step * eccsize, tmp_buf,
+ nand_extract_bits(buf, step * eccsize * 8, tmp_buf,
src_bit_off, eccsize * 8);
src_bit_off += eccsize * 8;