summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/cbfs.h2
-rw-r--r--src/lib/cbfs.c14
2 files changed, 9 insertions, 7 deletions
diff --git a/src/include/cbfs.h b/src/include/cbfs.h
index bca089a73b..a6b2c027b3 100644
--- a/src/include/cbfs.h
+++ b/src/include/cbfs.h
@@ -52,7 +52,7 @@
#include <boot/coreboot_tables.h>
/** These are standard values for the known compression
alogrithms that coreboot knows about for stages and
- payloads. Of course, other LAR users can use whatever
+ payloads. Of course, other CBFS users can use whatever
values they want, as long as they understand them. */
#define CBFS_COMPRESS_NONE 0
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index ad45ece95a..780d69f488 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -29,6 +29,8 @@
#define ntohl(x) (x)
#endif
+unsigned long ulzma(unsigned char *src, unsigned char *dst);
+
int cbfs_decompress(int algo, void *src, void *dst, int len)
{
switch(algo) {
@@ -36,15 +38,15 @@ int cbfs_decompress(int algo, void *src, void *dst, int len)
memcpy(dst, src, len);
return 0;
- case CBFS_COMPRESS_LZMA: {
- unsigned long ulzma(unsigned char *src, unsigned char *dst);
- ulzma(src, dst);
- }
+ case CBFS_COMPRESS_LZMA:
+ if (!ulzma(src, dst)) {
+ printk_err("CBFS: LZMA decompression failed!\n");
+ return -1;
+ }
return 0;
default:
- printk_info( "CBFS: Unknown compression type %d\n",
- algo);
+ printk_info( "CBFS: Unknown compression type %d\n", algo);
return -1;
}
}