summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2011-07-14 00:42:09 +0200
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-14 00:42:09 +0200
commit8918673cf79f20f0fd9cb735c3ed3510842fc625 (patch)
treec8731a078a8c2083887c63c5bc1e407f8c0e16b3
parentMerge "Update usb_connected() to support new gadget driver" (diff)
parentCheck pointer for null before dereferencing (diff)
downloadandroid_bootable_recovery-8918673cf79f20f0fd9cb735c3ed3510842fc625.tar
android_bootable_recovery-8918673cf79f20f0fd9cb735c3ed3510842fc625.tar.gz
android_bootable_recovery-8918673cf79f20f0fd9cb735c3ed3510842fc625.tar.bz2
android_bootable_recovery-8918673cf79f20f0fd9cb735c3ed3510842fc625.tar.lz
android_bootable_recovery-8918673cf79f20f0fd9cb735c3ed3510842fc625.tar.xz
android_bootable_recovery-8918673cf79f20f0fd9cb735c3ed3510842fc625.tar.zst
android_bootable_recovery-8918673cf79f20f0fd9cb735c3ed3510842fc625.zip
-rw-r--r--bootloader.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bootloader.c b/bootloader.c
index 709656602..baaddc55f 100644
--- a/bootloader.c
+++ b/bootloader.c
@@ -32,6 +32,10 @@ static int set_bootloader_message_block(const struct bootloader_message *in, con
int get_bootloader_message(struct bootloader_message *out) {
Volume* v = volume_for_path("/misc");
+ if (v == NULL) {
+ LOGE("Cannot load volume /misc!\n");
+ return -1;
+ }
if (strcmp(v->fs_type, "mtd") == 0) {
return get_bootloader_message_mtd(out, v);
} else if (strcmp(v->fs_type, "emmc") == 0) {
@@ -43,6 +47,10 @@ int get_bootloader_message(struct bootloader_message *out) {
int set_bootloader_message(const struct bootloader_message *in) {
Volume* v = volume_for_path("/misc");
+ if (v == NULL) {
+ LOGE("Cannot load volume /misc!\n");
+ return -1;
+ }
if (strcmp(v->fs_type, "mtd") == 0) {
return set_bootloader_message_mtd(in, v);
} else if (strcmp(v->fs_type, "emmc") == 0) {