]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
unlzo: Fix input buffer free
authorSascha Hauer <s.hauer@pengutronix.de>
Thu, 8 Dec 2011 04:42:59 +0000 (15:42 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Dec 2011 04:19:23 +0000 (15:19 +1100)
unlzo modifies the pointer to in_buf, so we have to free the original
buffer, not the modified pointer.  This only happens when a fill function
is passed, a case which is currently unused in the kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/decompress_unlzo.c

index 5a7a2adf4c4c2aa8d64d881e0ff1739acbe8782c..4531294fa62f2cb5de592178ddca2c0afc223558 100644 (file)
@@ -279,7 +279,7 @@ STATIC inline int INIT unlzo(u8 *input, int in_len,
        ret = 0;
 exit_2:
        if (!input)
-               free(in_buf);
+               free(in_buf_save);
 exit_1:
        if (!output)
                free(out_buf);