diff options
author | KOVACS Krisztian <hidden@sch.bme.hu> | 2014-08-22 04:44:35 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-08-29 09:46:35 -0400 |
commit | d801ab204b5a500b66ca285ac7b440cc79933a27 (patch) | |
tree | c85e733e33bf60f21fe018e9529cd12b9479f0ba /crypto/lz4hc.c | |
parent | 51269ad2880774e7d46fb1e0edb7a83e15d05d33 (diff) |
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/lz4hc.c')
-rw-r--r-- | crypto/lz4hc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/lz4hc.c b/crypto/lz4hc.c index 151ba31d34e3..9218b3fed5e3 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, | |||
68 | size_t tmp_len = *dlen; | 68 | size_t tmp_len = *dlen; |
69 | size_t __slen = slen; | 69 | size_t __slen = slen; |
70 | 70 | ||
71 | err = lz4_decompress(src, &__slen, dst, tmp_len); | 71 | err = lz4_decompress_unknownoutputsize(src, __slen, dst, &tmp_len); |
72 | if (err < 0) | 72 | if (err < 0) |
73 | return -EINVAL; | 73 | return -EINVAL; |
74 | 74 | ||