xen/unlz4: always set an error return code on failures
authorJan Beulich <jbeulich@suse.com>
Tue, 28 Jan 2014 12:31:28 +0000 (13:31 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 28 Jan 2014 12:31:28 +0000 (13:31 +0100)
"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.

Linux commit: 2a1d689c9ba42a6066540fb221b6ecbd6298b728

Reported-by: Matthew Daley <mattjd@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/common/unlz4.c

index 195d8299a2a33c78a6101848655658ab7f595f13..9dcaec7e84cca734c9f842c6294c4b744a324d02 100644 (file)
@@ -133,6 +133,7 @@ STATIC int INIT unlz4(unsigned char *input, unsigned int in_len,
                        goto exit_2;
                }
 
+               ret = -1;
                if (flush && flush(outp, dest_len) != dest_len)
                        goto exit_2;
                if (output)