Check the return value of ulzma, and quit instead of loading the next
segment if there's an error.
Size pointers 8 characters instead of 16 to beautify the common case
where selfboot is loading something into memory below 4GB.
Signed-off-by: Myles Watson <[email protected]>
Thanks,
Myles
Index: src/boot/selfboot.c
===================================================================
--- src/boot/selfboot.c (revision 5521)
+++ src/boot/selfboot.c (working copy)
@@ -473,6 +473,8 @@
case CBFS_COMPRESS_LZMA: {
printk(BIOS_DEBUG, "using LZMA\n");
len = ulzma(src, dest);
+ if (!len) /* Decompression Error. */
+ return 0;
break;
}
#if CONFIG_COMPRESSED_PAYLOAD_NRV2B==1
@@ -495,7 +497,7 @@
}
end = dest + ptr->s_memsz;
middle = dest + len;
- printk(BIOS_SPEW, "[ 0x%016lx, %016lx, 0x%016lx) <- %016lx\n",
+ printk(BIOS_SPEW, "[ 0x%08lx, %08lx, 0x%08lx) <- %08lx\n",
(unsigned long)dest,
(unsigned long)middle,
(unsigned long)end,
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot