mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] lib/decompress: Set the compressor name to NULL on error
@ 2015-07-15  6:44 Aneesh Kumar K.V
  0 siblings, 0 replies; only message in thread
From: Aneesh Kumar K.V @ 2015-07-15  6:44 UTC (permalink / raw)
  To: Andrew Morton,  H. Peter Anvin; +Cc: linux-kernel, Aneesh Kumar K.V

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>
---
 lib/decompress.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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]);
 
-- 
2.1.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-15  6:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-15  6:44 [PATCH] lib/decompress: Set the compressor name to NULL on error Aneesh Kumar K.V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome