From: Aneesh Kumar K.V Date: Fri, 17 Jul 2015 23:24:26 +0000 (-0700) Subject: lib/decompress: set the compressor name to NULL on error X-Git-Tag: v4.2-rc3~11^2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=5a09e6ce90e1bf26f0915e7e31329402766ffead;p=linux.git 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 Cc: "H. Peter Anvin" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/decompress.c b/lib/decompress.c index 528ff932d8e4..62696dff5730 100644 --- a/lib/decompress.c +++ b/lib/decompress.c @@ -59,8 +59,11 @@ decompress_fn __init decompress_method(const unsigned char *inbuf, long len, { const struct compress_format *cf; - if (len < 2) + if (len < 2) { + if (name) + *name = NULL; return NULL; /* Need at least this much... */ + } pr_debug("Compressed data magic: %#.2x %#.2x\n", inbuf[0], inbuf[1]);