Skip to content
Snippets Groups Projects
Commit 3500e9ae authored by Nobuhiro Iwamatsu's avatar Nobuhiro Iwamatsu Committed by Wolfgang Denk
Browse files

kwbimage: Fix check variable of checksum


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

Signed-off-by: default avatarNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
parent 201a017c
No related branches found
No related tags found
No related merge requests found
...@@ -356,7 +356,7 @@ static int kwbimage_verify_header (unsigned char *ptr, int image_size, ...@@ -356,7 +356,7 @@ static int kwbimage_verify_header (unsigned char *ptr, int image_size,
calc_exthdrcsum = kwbimage_checksum8 ((void *)exthdr, calc_exthdrcsum = kwbimage_checksum8 ((void *)exthdr,
sizeof(extbhr_t) - sizeof(uint8_t), 0); 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 -FDT_ERR_BADSTRUCTURE; /* exthdr csum not matched */
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment