From: Jan Beulich Date: Fri, 3 Jan 2014 03:10:36 +0000 (+1100) Subject: lib/decompress_unlz4.c: always set an error return code on failures X-Git-Tag: next-20140106~2^2~5 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4d6ff2cbe16e8339a8c00c4bfd83e79a3478eda1;p=karo-tx-linux.git lib/decompress_unlz4.c: always set an error return code on failures "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 Signed-off-by: Jan Beulich Cc: Kyungsik Lee Signed-off-by: Andrew Morton --- diff --git a/lib/decompress_unlz4.c b/lib/decompress_unlz4.c index 3e67cfad16ad..7d1e83caf8ad 100644 --- a/lib/decompress_unlz4.c +++ b/lib/decompress_unlz4.c @@ -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)