Skip to content

Commit

Permalink
lib/decompress_unlz4.c: always set an error return code on failures
Browse files Browse the repository at this point in the history
"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 <[email protected]>
Signed-off-by: Jan Beulich <[email protected]>
Cc: Kyungsik Lee <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jbeulich authored and torvalds committed Jan 24, 2014
1 parent 40e2c71 commit 2a1d689
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/decompress_unlz4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2a1d689

Please sign in to comment.