]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
lib/decompress_unlz4.c: always set an error return code on failures
authorJan Beulich <JBeulich@suse.com>
Fri, 3 Jan 2014 03:10:36 +0000 (14:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:10:36 +0000 (14:10 +1100)
"ret", being set to -1 early on, gets cleared by the first invocation of
lz4_decompress()/lz4_decompress_unknownoutputsize(), and hence subsequent
failures wouldn't be noticed by the caller without setting it back to -1
right after those calls.

Reported-by: Matthew Daley <mattjd@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/decompress_unlz4.c

index 3e67cfad16ad53614508e126d87f4d0024128577..7d1e83caf8ad8512c3a0d39e4f5e5b5c39de619f 100644 (file)
@@ -141,6 +141,7 @@ STATIC inline int INIT unlz4(u8 *input, int in_len,
                        goto exit_2;
                }
 
+               ret = -1;
                if (flush && flush(outp, dest_len) != dest_len)
                        goto exit_2;
                if (output)