diff options
author | Sven Schmidt <4sschmid@informatik.uni-hamburg.de> | 2017-02-24 18:01:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-24 20:46:57 -0500 |
commit | e23d54e48346e775be53b3cc25a95d65da960393 (patch) | |
tree | d5831aa34a8bd01fd9e31fbeb3d392731d19e6a7 | |
parent | 4e1a33b105ddf201f66dcc44490c6086a25eca0b (diff) |
lib/decompress_unlz4: change module to work with new LZ4 module version
Update the unlz4 wrapper to work with the updated LZ4 kernel module
version.
Link: http://lkml.kernel.org/r/1486321748-19085-3-git-send-email-4sschmid@informatik.uni-hamburg.de
Signed-off-by: Sven Schmidt <4sschmid@informatik.uni-hamburg.de>
Cc: Bongkyu Kim <bongkyu.kim@lge.com>
Cc: Rui Salvaterra <rsalvaterra@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David S. Miller <davem@davemloft.net>
Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Colin Cross <ccross@android.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | lib/decompress_unlz4.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/decompress_unlz4.c b/lib/decompress_unlz4.c index 036fc882cd72..1b0baf3008ea 100644 --- a/lib/decompress_unlz4.c +++ b/lib/decompress_unlz4.c | |||
@@ -72,7 +72,7 @@ STATIC inline int INIT unlz4(u8 *input, long in_len, | |||
72 | error("NULL input pointer and missing fill function"); | 72 | error("NULL input pointer and missing fill function"); |
73 | goto exit_1; | 73 | goto exit_1; |
74 | } else { | 74 | } else { |
75 | inp = large_malloc(lz4_compressbound(uncomp_chunksize)); | 75 | inp = large_malloc(LZ4_compressBound(uncomp_chunksize)); |
76 | if (!inp) { | 76 | if (!inp) { |
77 | error("Could not allocate input buffer"); | 77 | error("Could not allocate input buffer"); |
78 | goto exit_1; | 78 | goto exit_1; |
@@ -136,7 +136,7 @@ STATIC inline int INIT unlz4(u8 *input, long in_len, | |||
136 | inp += 4; | 136 | inp += 4; |
137 | size -= 4; | 137 | size -= 4; |
138 | } else { | 138 | } else { |
139 | if (chunksize > lz4_compressbound(uncomp_chunksize)) { | 139 | if (chunksize > LZ4_compressBound(uncomp_chunksize)) { |
140 | error("chunk length is longer than allocated"); | 140 | error("chunk length is longer than allocated"); |
141 | goto exit_2; | 141 | goto exit_2; |
142 | } | 142 | } |
@@ -152,11 +152,14 @@ STATIC inline int INIT unlz4(u8 *input, long in_len, | |||
152 | out_len -= dest_len; | 152 | out_len -= dest_len; |
153 | } else | 153 | } else |
154 | dest_len = out_len; | 154 | dest_len = out_len; |
155 | ret = lz4_decompress(inp, &chunksize, outp, dest_len); | 155 | |
156 | ret = LZ4_decompress_fast(inp, outp, dest_len); | ||
157 | chunksize = ret; | ||
156 | #else | 158 | #else |
157 | dest_len = uncomp_chunksize; | 159 | dest_len = uncomp_chunksize; |
158 | ret = lz4_decompress_unknownoutputsize(inp, chunksize, outp, | 160 | |
159 | &dest_len); | 161 | ret = LZ4_decompress_safe(inp, outp, chunksize, dest_len); |
162 | dest_len = ret; | ||
160 | #endif | 163 | #endif |
161 | if (ret < 0) { | 164 | if (ret < 0) { |
162 | error("Decoding failed"); | 165 | error("Decoding failed"); |