提交 3500e9ae 编写于 作者: N Nobuhiro Iwamatsu 提交者: Wolfgang Denk

kwbimage: Fix check variable of checksum

calc_hdrcsum two times are checked. checksumi of exthdr is not checked.
Signed-off-by: NNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
上级 201a017c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册