mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-11-17 07:04:01 +08:00
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>
This commit is contained in:
parent
d56e84b406
commit
5a09e6ce90
@ -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]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user