提交 5a09e6ce 编写于 作者: A Aneesh Kumar K.V 提交者: Linus Torvalds

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: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d56e84b4
...@@ -59,8 +59,11 @@ decompress_fn __init decompress_method(const unsigned char *inbuf, long len, ...@@ -59,8 +59,11 @@ decompress_fn __init decompress_method(const unsigned char *inbuf, long len,
{ {
const struct compress_format *cf; const struct compress_format *cf;
if (len < 2) if (len < 2) {
if (name)
*name = NULL;
return NULL; /* Need at least this much... */ return NULL; /* Need at least this much... */
}
pr_debug("Compressed data magic: %#.2x %#.2x\n", inbuf[0], inbuf[1]); pr_debug("Compressed data magic: %#.2x %#.2x\n", inbuf[0], inbuf[1]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册