From cffdf180fd64d27665eb4751dfb9b4eb0244c0d7 Mon Sep 17 00:00:00 2001 From: Phillip Lougher Date: Mon, 14 Dec 2009 21:45:19 +0000 Subject: [PATCH] --- yaml --- r: 178047 b: refs/heads/master c: 54291362d2a5738e1b0495df2abcb9e6b0563a3f h: refs/heads/master i: 178045: 46c361431cee60edb50d16e6e9a990e23b518752 178043: fb92ef762125a6526f24f431647930213737097e 178039: ca80a35194b88b581475e4e75cf40cc2a451a24b 178031: be4cc739e8dda590898eaa07fe0b71faf50c5361 178015: 34f014646fa920d509643ac84bec9b2aecb3b308 177983: 8e90e2f47dd09ae14d674a66da2a995c2f697739 177919: 9c7efbf930ff8fb33a71613e08ae1e2a30709850 v: v3 --- [refs] | 2 +- trunk/init/initramfs.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index f35e158a9fcc..ae0e40a5161d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d4529862cae4de19fda8d4bbcbddc60f3e48a4cf +refs/heads/master: 54291362d2a5738e1b0495df2abcb9e6b0563a3f diff --git a/trunk/init/initramfs.c b/trunk/init/initramfs.c index 4c00edc59689..b37d34beb90b 100644 --- a/trunk/init/initramfs.c +++ b/trunk/init/initramfs.c @@ -413,7 +413,7 @@ static unsigned my_inptr; /* index of next byte to be processed in inbuf */ static char * __init unpack_to_rootfs(char *buf, unsigned len) { - int written; + int written, res; decompress_fn decompress; const char *compress_name; static __initdata char msg_buf[64]; @@ -445,10 +445,12 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len) } this_header = 0; decompress = decompress_method(buf, len, &compress_name); - if (decompress) - decompress(buf, len, NULL, flush_buffer, NULL, + if (decompress) { + res = decompress(buf, len, NULL, flush_buffer, NULL, &my_inptr, error); - else if (compress_name) { + if (res) + error("decompressor failed"); + } else if (compress_name) { if (!message) { snprintf(msg_buf, sizeof msg_buf, "compression method %s not configured",