Skip to content

Commit

Permalink
kwbimage: Fix check variable of checksum
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
iwamatsu authored and wdenx committed May 12, 2011
1 parent 201a017 commit 3500e9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/kwbimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3500e9a

Please sign in to comment.