From: Rebecca Schultz Zavin Date: Thu, 29 Apr 2010 20:36:55 +0000 (-0700) Subject: net: ppp_deflate: Switch z_decomp_alloc to vmalloced decompress buffers X-Git-Tag: firefly_0821_release~9834^2~509 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bfea4fcd5b2ec1a135aa465b6c4ceb16c2c63d4e;p=firefly-linux-kernel-4.4.55.git net: ppp_deflate: Switch z_decomp_alloc to vmalloced decompress buffers On systems with high memory pressure, allocating an order 4 contiguous region for decompression can fail at run time. Instead use virtually contigous memory allocated via vmalloc. Change-Id: I7821882bd183a1de0d73ab2932f6e6978e4f0970 Signed-off-by: Rebecca Schultz Zavin --- diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c index 695bc83e0cfd..bda70852c5ef 100644 --- a/drivers/net/ppp_deflate.c +++ b/drivers/net/ppp_deflate.c @@ -306,7 +306,7 @@ static void z_decomp_free(void *arg) if (state) { zlib_inflateEnd(&state->strm); - kfree(state->strm.workspace); + vfree(state->strm.workspace); kfree(state); } } @@ -346,8 +346,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len) state->w_size = w_size; state->strm.next_out = NULL; - state->strm.workspace = kmalloc(zlib_inflate_workspacesize(), - GFP_KERNEL|__GFP_REPEAT); + state->strm.workspace = vmalloc(zlib_inflate_workspacesize()); if (state->strm.workspace == NULL) goto out_free;