From: Myungho Jung Date: Mon, 10 Apr 2017 00:34:22 +0000 (-0700) Subject: crypto: lz4 - fixed decompress function to return error code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cd15f1020fd627d795e60a142d1f00f7fc1fe7f3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Herbert Xu --- 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, int out_len = LZ4_decompress_safe(src, dst, slen, *dlen); if (out_len < 0) - return out_len; + return -EINVAL; *dlen = out_len; 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, int out_len = LZ4_decompress_safe(src, dst, slen, *dlen); if (out_len < 0) - return out_len; + return -EINVAL; *dlen = out_len; return 0;