Skip to content

Commit 4883a60

Browse files
sknseanmiquelraynal
authored andcommitted
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: e5e5631 ("mtd: rawnand: gpmi: Use nand_extract_bits()") Cc: stable@vger.kernel.org Reported-by: Martin Hundebøll <martin@geanix.com> Signed-off-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20201221100013.2715675-1-sean@geanix.com
1 parent 5c8fe58 commit 4883a60

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ static int gpmi_ecc_read_page_raw(struct nand_chip *chip, uint8_t *buf,
16151615
/* Extract interleaved payload data and ECC bits */
16161616
for (step = 0; step < nfc_geo->ecc_chunk_count; step++) {
16171617
if (buf)
1618-
nand_extract_bits(buf, step * eccsize, tmp_buf,
1618+
nand_extract_bits(buf, step * eccsize * 8, tmp_buf,
16191619
src_bit_off, eccsize * 8);
16201620
src_bit_off += eccsize * 8;
16211621

0 commit comments

Comments
 (0)