[U-Boot] [PATCH] kwbimage: Fix check variable of checksum

Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj at renesas.com
Wed May 11 05:33:08 CEST 2011


From: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>

calc_hdrcsum two times are checked. checksumi of exthdr is not checked.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj at renesas.com>
CC: Prafulla Wadaskar <prafulla at marvell.com>
---
 tools/kwbimage.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 964796e..f327b07 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -356,7 +356,7 @@ static int kwbimage_verify_header (unsigned char *ptr, int image_size,
 
 	calc_exthdrcsum = kwbimage_checksum8 ((void *)exthdr,
 			sizeof(extbhr_t) - sizeof(uint8_t), 0);
-	if (calc_hdrcsum != mhdr->checkSum)
+	if (calc_exthdrcsum != exthdr->checkSum)
 		return -FDT_ERR_BADSTRUCTURE; /* exthdr csum not matched */
 
 	return 0;
-- 
1.7.5.1



More information about the U-Boot mailing list