|
@@ -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)
|
|
static char * __init unpack_to_rootfs(char *buf, unsigned len)
|
|
{
|
|
{
|
|
- int written;
|
|
|
|
|
|
+ int written, res;
|
|
decompress_fn decompress;
|
|
decompress_fn decompress;
|
|
const char *compress_name;
|
|
const char *compress_name;
|
|
static __initdata char msg_buf[64];
|
|
static __initdata char msg_buf[64];
|
|
@@ -445,10 +445,12 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len)
|
|
}
|
|
}
|
|
this_header = 0;
|
|
this_header = 0;
|
|
decompress = decompress_method(buf, len, &compress_name);
|
|
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);
|
|
&my_inptr, error);
|
|
- else if (compress_name) {
|
|
|
|
|
|
+ if (res)
|
|
|
|
+ error("decompressor failed");
|
|
|
|
+ } else if (compress_name) {
|
|
if (!message) {
|
|
if (!message) {
|
|
snprintf(msg_buf, sizeof msg_buf,
|
|
snprintf(msg_buf, sizeof msg_buf,
|
|
"compression method %s not configured",
|
|
"compression method %s not configured",
|