diff mbox

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

Message ID 1305084788-19689-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com
State Accepted
Commit 3500e9aed6e13a988f4a5ef6503112fda1c4a7fc
Headers show

Commit Message

Nobuhiro Iwamatsu May 11, 2011, 3:33 a.m. UTC
From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

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>
---
 tools/kwbimage.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Wolfgang Denk May 12, 2011, 9:53 p.m. UTC | #1
Dear Nobuhiro Iwamatsu,

In message <1305084788-19689-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> you wrote:
> From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
> 
> 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>
> ---
>  tools/kwbimage.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
diff mbox

Patch

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;