diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index a8f85e93b28..905567293cd 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -350,7 +350,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) printf (" Uncompressing %s ... ", type_name); if (gunzip ((void *)load, unc_len, (uchar *)image_start, &image_len) != 0) { - puts ("GUNZIP: uncompress or overwrite error " + puts ("GUNZIP: uncompress, out-of-mem or overwrite error " "- must RESET board to recover\n"); if (boot_progress) show_boot_progress (-6); diff --git a/lib_generic/gunzip.c b/lib_generic/gunzip.c index 74f0bf9f3e1..5bcf5b7b24f 100644 --- a/lib_generic/gunzip.c +++ b/lib_generic/gunzip.c @@ -102,8 +102,9 @@ int gunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp) s.next_out = dst; s.avail_out = dstlen; r = inflate(&s, Z_FINISH); - if (r != Z_OK && r != Z_STREAM_END) { + if (r != Z_STREAM_END) { printf ("Error: inflate() returned %d\n", r); + inflateEnd(&s); return (-1); } *lenp = s.next_out - (unsigned char *) dst;