Merge "app: aboot: add null pointer check in fastboot test"
diff --git a/app/aboot/fastboot_test.c b/app/aboot/fastboot_test.c
index 64c0f7f..70bc64e 100644
--- a/app/aboot/fastboot_test.c
+++ b/app/aboot/fastboot_test.c
@@ -88,6 +88,13 @@
dprintf(INFO, "Running RPMB test case, please make sure RPMB key is provisioned ...\n");
struct device_info *write_info = memalign(PAGE_SIZE, 4096);
struct device_info *read_info = memalign(PAGE_SIZE, 4096);
+
+ if((write_info == NULL)||(read_info == NULL))
+ {
+ dprintf(CRITICAL, "Failed to allocate memory for devinfo %s %d \n",__FUNCTION__,__LINE__);
+ goto err;
+ }
+
if((read_device_info_rpmb((void*) read_info, PAGE_SIZE)) < 0)
dprintf(INFO, "RPMB READ TEST : [ FAIL ]\n");
@@ -104,6 +111,7 @@
else
dprintf(INFO, "RPMB READ/WRITE TEST: [ FAIL ]\n");
+err:
free(read_info);
free(write_info);
#endif