common: android: skip blk read and memcpy if image size is 0
blk_read() may return error code if image size is 0, it depends on block layer implementation. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Change-Id: I29bab10835e9029780a957e871a600a6fbdf6068
This commit is contained in:
parent
7edaca2270
commit
b6b05c7154
|
|
@ -374,6 +374,9 @@ static int image_read(img_t img, struct andr_img_hdr *hdr,
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (!blksz || !datasz)
|
||||
goto crypto_calc;
|
||||
|
||||
/* load */
|
||||
if (ram_base) {
|
||||
memcpy(ramdst, (char *)((ulong)ram_base + offset), datasz);
|
||||
|
|
@ -386,6 +389,7 @@ static int image_read(img_t img, struct andr_img_hdr *hdr,
|
|||
}
|
||||
}
|
||||
|
||||
crypto_calc:
|
||||
/* sha1 */
|
||||
#ifdef CONFIG_DM_CRYPTO
|
||||
if (crypto) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue