summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMyungho Jung <mhjungk@gmail.com>2017-04-09 20:34:22 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2017-04-10 07:17:27 -0400
commitcd15f1020fd627d795e60a142d1f00f7fc1fe7f3 (patch)
tree72f5c44eb6bcce1e4dd20ea16849951ec88190ea
parent07a77929ba672d93642a56dc2255dd21e6e2290b (diff)
crypto: lz4 - fixed decompress function to return error code
Decompress function in LZ4 library is supposed to return an error code or negative result. But, it returns -1 when any error is detected. Return error code when the library returns negative value. Signed-off-by: Myungho Jung <mhjungk@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-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 71eff9b01b12..2ce2660d3519 100644
--- a/crypto/lz4.c
+++ b/crypto/lz4.c
@@ -97,7 +97,7 @@ static int __lz4_decompress_crypto(const u8 *src, unsigned int slen,
97 int out_len = LZ4_decompress_safe(src, dst, slen, *dlen); 97 int out_len = LZ4_decompress_safe(src, dst, slen, *dlen);
98 98
99 if (out_len < 0) 99 if (out_len < 0)
100 return out_len; 100 return -EINVAL;
101 101
102 *dlen = out_len; 102 *dlen = out_len;
103 return 0; 103 return 0;
diff --git a/crypto/lz4hc.c b/crypto/lz4hc.c
index 03a34a8109c0..2be14f054daf 100644
--- a/crypto/lz4hc.c
+++ b/crypto/lz4hc.c
@@ -98,7 +98,7 @@ static int __lz4hc_decompress_crypto(const u8 *src, unsigned int slen,
98 int out_len = LZ4_decompress_safe(src, dst, slen, *dlen); 98 int out_len = LZ4_decompress_safe(src, dst, slen, *dlen);
99 99
100 if (out_len < 0) 100 if (out_len < 0)
101 return out_len; 101 return -EINVAL;
102 102
103 *dlen = out_len; 103 *dlen = out_len;
104 return 0; 104 return 0;