From ac8e2cd3b18cff9d33ec2884b8e75bfc2a2b8c5e Mon Sep 17 00:00:00 2001 From: Sven Schmidt <4sschmid@informatik.uni-hamburg.de> Date: Fri, 24 Feb 2017 15:01:22 -0800 Subject: fs/squashfs: change usage of LZ4 to work with new LZ4 version Update fs/squashfs to use the updated functions from the new LZ4 module. Link: http://lkml.kernel.org/r/1486321748-19085-5-git-send-email-4sschmid@informatik.uni-hamburg.de Signed-off-by: Sven Schmidt <4sschmid@informatik.uni-hamburg.de> Cc: Bongkyu Kim Cc: Rui Salvaterra Cc: Sergey Senozhatsky Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: David S. Miller Cc: Anton Vorontsov Cc: Colin Cross Cc: Kees Cook Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/squashfs/lz4_wrapper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fs/squashfs') diff --git a/fs/squashfs/lz4_wrapper.c b/fs/squashfs/lz4_wrapper.c index df4fa3c7d..5d8512534 100644 --- a/fs/squashfs/lz4_wrapper.c +++ b/fs/squashfs/lz4_wrapper.c @@ -95,18 +95,18 @@ static int lz4_uncompress(struct squashfs_sb_info *msblk, void *strm, struct squashfs_page_actor *output) { int res; - size_t dest_len = output->length; struct squashfs_lz4 *stream = strm; squashfs_bh_to_buf(bh, b, stream->input, offset, length, msblk->devblksize); - res = lz4_decompress_unknownoutputsize(stream->input, length, - stream->output, &dest_len); - if (res) + res = LZ4_decompress_safe(stream->input, stream->output, + length, output->length); + + if (res < 0) return -EIO; - squashfs_buf_to_actor(stream->output, output, dest_len); + squashfs_buf_to_actor(stream->output, output, res); - return dest_len; + return res; } const struct squashfs_decompressor squashfs_lz4_comp_ops = { -- cgit v1.2.3