diff options
author | David S. Miller <davem@davemloft.net> | 2011-06-29 05:48:41 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-29 05:48:41 -0700 |
commit | 4f9657fc7724b5ad639605b496ab35c1dc35a032 (patch) | |
tree | b37f63d855c253dada297c8de52267c378830957 /crypto/deflate.c | |
parent | d466c844e8194feeef1da6ed32e8b2ca1cf5d4f2 (diff) | |
download | linux-crypto-4f9657fc7724b5ad639605b496ab35c1dc35a032.tar.gz linux-crypto-4f9657fc7724b5ad639605b496ab35c1dc35a032.zip |
net+crypto: Use vmalloc for zlib inflate buffers.
They are 64K and result in order-4 allocations, even with SLUB.
Therefore, just like we always have for the deflate buffers, use
vmalloc.
Reported-by: Martin Jackson <mjackson220.list@gmail.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | crypto/deflate.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crypto/deflate.c b/crypto/deflate.c index b5ccae29..b0165eca 100644 --- a/crypto/deflate.c +++ b/crypto/deflate.c @@ -32,7 +32,6 @@ #include <linux/interrupt.h> #include <linux/mm.h> #include <linux/net.h> -#include <linux/slab.h> #define DEFLATE_DEF_LEVEL Z_DEFAULT_COMPRESSION #define DEFLATE_DEF_WINBITS 11 @@ -73,7 +72,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx) int ret = 0; struct z_stream_s *stream = &ctx->decomp_stream; - stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL); + stream->workspace = vzalloc(zlib_inflate_workspacesize()); if (!stream->workspace) { ret = -ENOMEM; goto out; @@ -86,7 +85,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx) out: return ret; out_free: - kfree(stream->workspace); + vfree(stream->workspace); goto out; } @@ -99,7 +98,7 @@ static void deflate_comp_exit(struct deflate_ctx *ctx) static void deflate_decomp_exit(struct deflate_ctx *ctx) { zlib_inflateEnd(&ctx->decomp_stream); - kfree(ctx->decomp_stream.workspace); + vfree(ctx->decomp_stream.workspace); } static int deflate_init(struct crypto_tfm *tfm) |