Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/decompress: set the compressor name to NULL on error

Without this we end up using the previous name of the compressor in the
loop in unpack_rootfs. For example we get errors like "compression
method gzip not configured" even when we have CONFIG_DECOMPRESS_GZIP
enabled.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Aneesh Kumar K.V and committed by
Linus Torvalds
5a09e6ce d56e84b4

+4 -1
+4 -1
lib/decompress.c
··· 59 59 { 60 60 const struct compress_format *cf; 61 61 62 - if (len < 2) 62 + if (len < 2) { 63 + if (name) 64 + *name = NULL; 63 65 return NULL; /* Need at least this much... */ 66 + } 64 67 65 68 pr_debug("Compressed data magic: %#.2x %#.2x\n", inbuf[0], inbuf[1]); 66 69