Fix nullpointer when recovery.fstab does not define a "misc" partition

Change-Id: I57437e3c637a1c619d254a3fc025db19ffe53c10
This commit is contained in:
Kolja Dummann 2010-12-28 23:54:29 +01:00
parent c8ff793bf4
commit 7501798fab

View File

@ -30,23 +30,33 @@ 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 (strcmp(v->fs_type, "mtd") == 0) {
return get_bootloader_message_mtd(out, v);
} else if (strcmp(v->fs_type, "emmc") == 0) {
return get_bootloader_message_block(out, v);
if(v)
{
if (strcmp(v->fs_type, "mtd") == 0) {
return get_bootloader_message_mtd(out, v);
} else if (strcmp(v->fs_type, "emmc") == 0) {
return get_bootloader_message_block(out, v);
}
LOGE("unknown misc partition fs_type \"%s\"\n", v->fs_type);
return -1;
}
LOGE("unknown misc partition fs_type \"%s\"\n", v->fs_type);
LOGE("no misc partition\n");
return -1;
}
int set_bootloader_message(const struct bootloader_message *in) {
Volume* v = volume_for_path("/misc");
if (strcmp(v->fs_type, "mtd") == 0) {
return set_bootloader_message_mtd(in, v);
} else if (strcmp(v->fs_type, "emmc") == 0) {
return set_bootloader_message_block(in, v);
if(v)
{
if (strcmp(v->fs_type, "mtd") == 0) {
return set_bootloader_message_mtd(in, v);
} else if (strcmp(v->fs_type, "emmc") == 0) {
return set_bootloader_message_block(in, v);
}
LOGE("unknown misc partition fs_type \"%s\"\n", v->fs_type);
return -1;
}
LOGE("unknown misc partition fs_type \"%s\"\n", v->fs_type);
LOGE("no misc partition\n");
return -1;
}