From f177b7eee06984f18dc3edb509b9c7246cce25a1 Mon Sep 17 00:00:00 2001 From: Phillip Lougher Date: Thu, 5 Aug 2010 04:51:50 +0100 Subject: [PATCH] --- yaml --- r: 208874 b: refs/heads/master c: f3065f60ddfd4b5e34a412851d91d0cf27cdbf7e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/squashfs/lzo_wrapper.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index c094f93a6e41..b90b2f1ae6c5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 79cb8ced7eef53856b5a877db0544acf52e00c80 +refs/heads/master: f3065f60ddfd4b5e34a412851d91d0cf27cdbf7e diff --git a/trunk/fs/squashfs/lzo_wrapper.c b/trunk/fs/squashfs/lzo_wrapper.c index e1f86ded0ee5..5d87789bf1c1 100644 --- a/trunk/fs/squashfs/lzo_wrapper.c +++ b/trunk/fs/squashfs/lzo_wrapper.c @@ -40,13 +40,15 @@ struct squashfs_lzo { static void *lzo_init(struct squashfs_sb_info *msblk) { + int block_size = max_t(int, msblk->block_size, SQUASHFS_METADATA_SIZE); + struct squashfs_lzo *stream = kzalloc(sizeof(*stream), GFP_KERNEL); if (stream == NULL) goto failed; - stream->input = vmalloc(msblk->block_size); + stream->input = vmalloc(block_size); if (stream->input == NULL) goto failed; - stream->output = vmalloc(msblk->block_size); + stream->output = vmalloc(block_size); if (stream->output == NULL) goto failed2; @@ -80,7 +82,7 @@ static int lzo_uncompress(struct squashfs_sb_info *msblk, void **buffer, struct squashfs_lzo *stream = msblk->stream; void *buff = stream->input; int avail, i, bytes = length, res; - size_t out_len = msblk->block_size; + size_t out_len = srclength; mutex_lock(&msblk->read_data_mutex);