diff options
| author | Len Brown <len.brown@intel.com> | 2011-03-23 02:34:54 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2011-03-23 02:34:54 -0400 |
| commit | 02e2407858fd62053bf60349c0e72cd1c7a4a60e (patch) | |
| tree | 0ebdbddc97d3abbc675916010e7771065b70c137 /crypto/zlib.c | |
| parent | 96e1c408ea8a556c5b51e0e7d56bd2afbfbf5fe9 (diff) | |
| parent | 6447f55da90b77faec1697d499ed7986bb4f6de6 (diff) | |
Merge branch 'linus' into release
Conflicts:
arch/x86/kernel/acpi/sleep.c
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'crypto/zlib.c')
| -rw-r--r-- | crypto/zlib.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/crypto/zlib.c b/crypto/zlib.c index 739b8fca4ce..d11d761a5e4 100644 --- a/crypto/zlib.c +++ b/crypto/zlib.c @@ -85,6 +85,7 @@ static int zlib_compress_setup(struct crypto_pcomp *tfm, void *params, struct zlib_ctx *ctx = crypto_tfm_ctx(crypto_pcomp_tfm(tfm)); struct z_stream_s *stream = &ctx->comp_stream; struct nlattr *tb[ZLIB_COMP_MAX + 1]; + int window_bits, mem_level; size_t workspacesize; int ret; @@ -94,7 +95,14 @@ static int zlib_compress_setup(struct crypto_pcomp *tfm, void *params, zlib_comp_exit(ctx); - workspacesize = zlib_deflate_workspacesize(); + window_bits = tb[ZLIB_COMP_WINDOWBITS] + ? nla_get_u32(tb[ZLIB_COMP_WINDOWBITS]) + : MAX_WBITS; + mem_level = tb[ZLIB_COMP_MEMLEVEL] + ? nla_get_u32(tb[ZLIB_COMP_MEMLEVEL]) + : DEF_MEM_LEVEL; + + workspacesize = zlib_deflate_workspacesize(window_bits, mem_level); stream->workspace = vzalloc(workspacesize); if (!stream->workspace) return -ENOMEM; @@ -106,12 +114,8 @@ static int zlib_compress_setup(struct crypto_pcomp *tfm, void *params, tb[ZLIB_COMP_METHOD] ? nla_get_u32(tb[ZLIB_COMP_METHOD]) : Z_DEFLATED, - tb[ZLIB_COMP_WINDOWBITS] - ? nla_get_u32(tb[ZLIB_COMP_WINDOWBITS]) - : MAX_WBITS, - tb[ZLIB_COMP_MEMLEVEL] - ? nla_get_u32(tb[ZLIB_COMP_MEMLEVEL]) - : DEF_MEM_LEVEL, + window_bits, + mem_level, tb[ZLIB_COMP_STRATEGY] ? nla_get_u32(tb[ZLIB_COMP_STRATEGY]) : Z_DEFAULT_STRATEGY); |
