Skip to content

Commit 7bb9c75

Browse files
sladkaniDavid Woodhouse
authored andcommitted
mtd: nand: Use the mirror BBT descriptor when reading its version
The code responsible for reading the version of the mirror bbt was incorrectly using the descriptor of the main bbt. Pass the mirror bbt descriptor to 'scan_read_raw' when reading the version of the mirror bbt. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: stable@vger.kernel.org [v2.6.37+] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent 75453a0 commit 7bb9c75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/nand/nand_bbt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static int read_abs_bbts(struct mtd_info *mtd, uint8_t *buf,
390390
/* Read the mirror version, if available */
391391
if (md && (md->options & NAND_BBT_VERSION)) {
392392
scan_read_raw(mtd, buf, (loff_t)md->pages[0] << this->page_shift,
393-
mtd->writesize, td);
393+
mtd->writesize, md);
394394
md->version[0] = buf[bbt_get_ver_offs(mtd, md)];
395395
pr_info("Bad block table at page %d, version 0x%02X\n",
396396
md->pages[0], md->version[0]);

0 commit comments

Comments
 (0)