diff options
author | Parth Dixit <parthd@codeaurora.org> | 2016-04-22 15:15:53 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-04-29 03:23:51 -0700 |
commit | 23b4eb8cae7b3fbf541cc97a37c1e33aba87dcfe (patch) | |
tree | 9d97a8f1ec0deb0f782a7bcc75e13c199a8ee8e1 | |
parent | 7e304c288fa3974629c3e7fd53c19d48311bdf57 (diff) |
app: aboot: add null pointer check in fastboot test
add null pointer check for devinfo in fastboot test.
Change-Id: I298806f929e66aa5945fc166ded15613ec49b688
-rw-r--r-- | app/aboot/fastboot_test.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/aboot/fastboot_test.c b/app/aboot/fastboot_test.c index 7941f612..4734b232 100644 --- a/app/aboot/fastboot_test.c +++ b/app/aboot/fastboot_test.c @@ -87,6 +87,13 @@ void cmd_oem_runtests() 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"); @@ -103,6 +110,7 @@ void cmd_oem_runtests() else dprintf(INFO, "RPMB READ/WRITE TEST: [ FAIL ]\n"); +err: free(read_info); free(write_info); #endif |