aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-06-29 08:48:41 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-29 08:48:41 -0400
commit7ab24bfdf9a9a9f87ac8e5ad9a25f80b5b947be7 (patch)
tree897d12fb7498316d05ce2ed48722fc78b61fc4e1 /drivers
parented6e4ef836d425bc35e33bf20fcec95e68203afa (diff)
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 'drivers')
-rw-r--r--drivers/net/bnx2x/bnx2x_main.c6
-rw-r--r--drivers/net/ppp_deflate.c5
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index 4b70311a11ef..74be989f51c5 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -49,6 +49,7 @@
49#include <linux/zlib.h> 49#include <linux/zlib.h>
50#include <linux/io.h> 50#include <linux/io.h>
51#include <linux/stringify.h> 51#include <linux/stringify.h>
52#include <linux/vmalloc.h>
52 53
53#define BNX2X_MAIN 54#define BNX2X_MAIN
54#include "bnx2x.h" 55#include "bnx2x.h"
@@ -4537,8 +4538,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp)
4537 if (bp->strm == NULL) 4538 if (bp->strm == NULL)
4538 goto gunzip_nomem2; 4539 goto gunzip_nomem2;
4539 4540
4540 bp->strm->workspace = kmalloc(zlib_inflate_workspacesize(), 4541 bp->strm->workspace = vmalloc(zlib_inflate_workspacesize());
4541 GFP_KERNEL);
4542 if (bp->strm->workspace == NULL) 4542 if (bp->strm->workspace == NULL)
4543 goto gunzip_nomem3; 4543 goto gunzip_nomem3;
4544 4544
@@ -4562,7 +4562,7 @@ gunzip_nomem1:
4562static void bnx2x_gunzip_end(struct bnx2x *bp) 4562static void bnx2x_gunzip_end(struct bnx2x *bp)
4563{ 4563{
4564 if (bp->strm) { 4564 if (bp->strm) {
4565 kfree(bp->strm->workspace); 4565 vfree(bp->strm->workspace);
4566 kfree(bp->strm); 4566 kfree(bp->strm);
4567 bp->strm = NULL; 4567 bp->strm = NULL;
4568 } 4568 }
diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c
index 31e9407a0739..1dbdf82a6dfd 100644
--- a/drivers/net/ppp_deflate.c
+++ b/drivers/net/ppp_deflate.c
@@ -305,7 +305,7 @@ static void z_decomp_free(void *arg)
305 305
306 if (state) { 306 if (state) {
307 zlib_inflateEnd(&state->strm); 307 zlib_inflateEnd(&state->strm);
308 kfree(state->strm.workspace); 308 vfree(state->strm.workspace);
309 kfree(state); 309 kfree(state);
310 } 310 }
311} 311}
@@ -345,8 +345,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len)
345 345
346 state->w_size = w_size; 346 state->w_size = w_size;
347 state->strm.next_out = NULL; 347 state->strm.next_out = NULL;
348 state->strm.workspace = kmalloc(zlib_inflate_workspacesize(), 348 state->strm.workspace = vmalloc(zlib_inflate_workspacesize());
349 GFP_KERNEL|__GFP_REPEAT);
350 if (state->strm.workspace == NULL) 349 if (state->strm.workspace == NULL)
351 goto out_free; 350 goto out_free;
352 351