summaryrefslogtreecommitdiff
path: root/crypto/lz4.c
diff options
context:
space:
mode:
authorKOVACS Krisztian <hidden@sch.bme.hu>2014-08-22 10:44:35 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2014-08-29 21:46:35 +0800
commit10cdef5f70578b9148e29ca0f8d9f12a49c5a681 (patch)
treea328155ea423332eb09cd6b3cf215a20c3d9788e /crypto/lz4.c
parent79964f3cea81c4a4af666e42be945273a83c55d9 (diff)
downloadlinux-crypto-10cdef5f70578b9148e29ca0f8d9f12a49c5a681.tar.gz
linux-crypto-10cdef5f70578b9148e29ca0f8d9f12a49c5a681.zip
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/lz4.c')
-rw-r--r--crypto/lz4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/lz4.c b/crypto/lz4.c
index 4586dd15..34d072b7 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;