Skip to contentSkip to conversation

NAND boot: fix nand_load overlap issue

PATCH New Mingkai Hu 3 participants 3 messages Jun 5, 2009 – Aug 4, 2009

lore
Share & tools
lore

Mingkai Hu

author
#0 lore raw

PATCH 1/1 NAND boot: fix nand_load overlap issue

The code copy data from NAND flash block by block, so when the data length isn't a whole-number multiple of the block size, it will overlap the rest space.

---
 nand_spl/nand_boot_fsl_elbc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
nand_spl/nand_boot_fsl_elbc.c +1 -1
index 0d0c44e..7f14a6f 100644
@@ -120,7 +120,7 @@ static void nand_load(unsigned int offs, int uboot_size, uchar *dst)
 
 			pos += page_size;
 			offs += page_size;
-		} while (offs & (block_size - 1));
+		} while ((offs & (block_size - 1)) && (pos < uboot_size));
 	}
 }
 
Signature · 1 line
1.5.4
#1 lore raw

PATCH 1/1 NAND boot: fix nand_load overlap issue

Dear Scott,

Quoted 8 lines · In message <[email protected]> Mingkai…

The code copy data from NAND flash block by block, so when the data length isn't a whole-number multiple of the block size, it will overlap the rest space.

---
 nand_spl/nand_boot_fsl_elbc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Can you please check the state of this patch? Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The X11 source code style is ATROCIOUS and should not be used  as  a
model."                                                   - Doug Gwyn
#2 lore raw

PATCH 1/1 NAND boot: fix nand_load overlap issue

Quoted 7 lines · Wolfgang Denk

Dear Scott,

Quoted 4 lines · In message <[email protected]> Mingkai…

The code copy data from NAND flash block by block, so when the data length isn't a whole-number multiple of the block size, it will overlap the rest space.

Quoted 7 lines
Quoted 4 lines
---
 nand_spl/nand_boot_fsl_elbc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Can you please check the state of this patch? Thanks in advance.

Applied to u-boot-nand-flash.

-Scott