summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <iwamatsu@nigauri.org>2011-05-10 17:33:08 +0000
committerWolfgang Denk <wd@denx.de>2011-05-12 23:53:41 +0200
commit3500e9aed6e13a988f4a5ef6503112fda1c4a7fc (patch)
tree84fd16b1a20bbe80a49b57989bdae6cc0ae0b376
parent201a017c2f3fad18e0d66c4fa1dc6ba6b8dd7fe7 (diff)
downloadu-boot-imx-3500e9aed6e13a988f4a5ef6503112fda1c4a7fc.zip
u-boot-imx-3500e9aed6e13a988f4a5ef6503112fda1c4a7fc.tar.gz
u-boot-imx-3500e9aed6e13a988f4a5ef6503112fda1c4a7fc.tar.bz2
kwbimage: Fix check variable of checksum
calc_hdrcsum two times are checked. checksumi of exthdr is not checked. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> CC: Prafulla Wadaskar <prafulla@marvell.com>
-rw-r--r--tools/kwbimage.c2
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;