Skip to content
Snippets Groups Projects
Commit 1e2c5bb9 authored by T Karthik Reddy's avatar T Karthik Reddy Committed by Tom Rini
Browse files

mtd: nand: Fix nand write error with bad block addresses above 32-bit


Nand writes should skip the bad blocks with "nand write" command.
In case of bad blocks with above 32-bit address, nand_block_isbad()
returns false due to truncated bad block address.

In below code segment,

	if (nand_block_isbad(mtd, offset & ~(mtd->erasesize - 1)))

offset is 64-bit and mtd->erasesize is 32-bit, hence the truncation is
happening. Cast 'mtd->erasesize' with loff_t to fix this issue.

Signed-off-by: default avatarT Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent 142775a5
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment