summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Ji <ji.luo@nxp.com>2018-02-12 16:33:49 +0800
committerzhang sanshan <sanshan.zhang@nxp.com>2018-02-23 14:01:37 +0800
commitd90d96134ac720c16262f13f30ee65e52314b27b (patch)
tree67d5a53ebc74062fedec5fa58d3eb5488e3e0ff3
parentde18b5fbb2e34c79437013926744156371f97dec (diff)
downloaduboot-imx-d90d96134ac720c16262f13f30ee65e52314b27b.tar.gz
MA-11363 [Android] Don't free memory for boot image in AVB
We read the boot image to a fixed partition which is defined in boot header, this part of memory should not be freed with free() otherwise "Synchronous Abort" error may happen. Change-Id: I0fd9a3e558fda90c4daeee3080e4f9b393e11d98 Signed-off-by: Luo Ji <ji.luo@nxp.com>
-rw-r--r--lib/avb/libavb/avb_slot_verify.c4
-rw-r--r--lib/avb/libavb_ab/avb_ab_flow.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/avb/libavb/avb_slot_verify.c b/lib/avb/libavb/avb_slot_verify.c
index 369165e113..0cec5cb7a7 100644
--- a/lib/avb/libavb/avb_slot_verify.c
+++ b/lib/avb/libavb/avb_slot_verify.c
@@ -1413,7 +1413,9 @@ AvbSlotVerifyResult avb_slot_verify(AvbOps* ops,
fail:
if (slot_data != NULL) {
- avb_slot_verify_data_free(slot_data);
+ /* the address of bootimage isn't alloced by malloc,
+ * we should not free it. */
+ avb_slot_verify_data_free_fast(slot_data);
}
return ret;
}
diff --git a/lib/avb/libavb_ab/avb_ab_flow.c b/lib/avb/libavb_ab/avb_ab_flow.c
index 0ef9255fc3..4d48b7366c 100644
--- a/lib/avb/libavb_ab/avb_ab_flow.c
+++ b/lib/avb/libavb_ab/avb_ab_flow.c
@@ -595,7 +595,9 @@ out:
for (n = 0; n < 2; n++) {
if (slot_data[n] != NULL) {
- avb_slot_verify_data_free(slot_data[n]);
+ /* the address of bootimage isn't alloced by malloc,
+ * we should not free it. */
+ avb_slot_verify_data_free_fast(slot_data[n]);
}
}
@@ -603,9 +605,7 @@ out:
*out_data = data;
} else {
if (data != NULL) {
- /* the address of bootimage isn't alloced by malloc,
- * we should not free it. */
- avb_slot_verify_data_free_fast(data);
+ avb_slot_verify_data_free(data);
}
}