From: Nobuhiro Iwamatsu Date: Tue, 10 May 2011 17:33:08 +0000 (+0000) Subject: kwbimage: Fix check variable of checksum X-Git-Tag: v2011.06-rc1~30 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3500e9aed6e13a988f4a5ef6503112fda1c4a7fc;p=u-boot kwbimage: Fix check variable of checksum calc_hdrcsum two times are checked. checksumi of exthdr is not checked. Signed-off-by: Nobuhiro Iwamatsu CC: Prafulla Wadaskar --- diff --git a/tools/kwbimage.c b/tools/kwbimage.c index 964796e9a6..f327b079b2 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;