aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorKOVACS Krisztian <hidden@sch.bme.hu>2014-08-22 10:44:35 +0200
committerZiyan <jaraidaniel@gmail.com>2016-01-05 18:21:57 +0100
commit3008cf34f4af6f5026a96490abdfabc346655663 (patch)
tree3e4401e11aff0870d4274f7115e42971b9741829 /crypto
parenta5933d5d744324168bc3d101c1f4515be79e0e22 (diff)
downloadkernel_samsung_tuna-3008cf34f4af6f5026a96490abdfabc346655663.zip
kernel_samsung_tuna-3008cf34f4af6f5026a96490abdfabc346655663.tar.gz
kernel_samsung_tuna-3008cf34f4af6f5026a96490abdfabc346655663.tar.bz2
crypto: lz4,lz4hc - fix decompression
The lz4 library has two functions for decompression, with slightly different signatures and behaviour. The lz4_decompress_crypto() function seemed to be using the one that assumes that the decompressed length is known in advance. This patch switches to the other decompression function and makes sure that the length of the decompressed output is properly returned to the caller. The same issue was present in the lz4hc algorithm. Coincidentally, this change also makes very basic lz4 and lz4hc compression tests in testmgr pass. Signed-off-by: KOVACS Krisztian <hidden@sch.bme.hu> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/lz4.c2
-rw-r--r--crypto/lz4hc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/crypto/lz4.c b/crypto/lz4.c
index 4586dd1..34d072b 100644
--- a/crypto/lz4.c
+++ b/crypto/lz4.c
@@ -68,7 +68,7 @@ static int lz4_decompress_crypto(struct crypto_tfm *tfm, const u8 *src,
size_t tmp_len = *dlen;
size_t __slen = slen;
- err = lz4_decompress(src, &__slen, dst, tmp_len);
+ err = lz4_decompress_unknownoutputsize(src, __slen, dst, &tmp_len);
if (err < 0)
return -EINVAL;
diff --git a/crypto/lz4hc.c b/crypto/lz4hc.c
index 151ba31..9218b3f 100644
--- a/crypto/lz4hc.c
+++ b/crypto/lz4hc.c
@@ -68,7 +68,7 @@ static int lz4hc_decompress_crypto(struct crypto_tfm *tfm, const u8 *src,
size_t tmp_len = *dlen;
size_t __slen = slen;
- err = lz4_decompress(src, &__slen, dst, tmp_len);
+ err = lz4_decompress_unknownoutputsize(src, __slen, dst, &tmp_len);
if (err < 0)
return -EINVAL;