X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=drivers%2Fnet%2Fppp_deflate.c;h=034c1c650bcba4a0b2ef1e7949d994b0a2e3b5ef;hp=f54c55242f4a26922c8c1414b6c4308209b99e9f;hb=5791ce18aa660df7d1dafebf6bd89d5aa05bd742;hpb=8a84fc15ae5cafcc366dd85cf8e1ab2040679abc diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c index f54c55242f4a..034c1c650bcb 100644 --- a/drivers/net/ppp_deflate.c +++ b/drivers/net/ppp_deflate.c @@ -121,12 +121,11 @@ static void *z_comp_alloc(unsigned char *options, int opt_len) if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) return NULL; - state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), + state = kzalloc(sizeof(*state), GFP_KERNEL); if (state == NULL) return NULL; - memset (state, 0, sizeof (struct ppp_deflate_state)); state->strm.next_in = NULL; state->w_size = w_size; state->strm.workspace = vmalloc(zlib_deflate_workspacesize()); @@ -207,7 +206,7 @@ static void z_comp_reset(void *arg) * Returns the length of the compressed packet, or 0 if the * packet is incompressible. */ -int z_compress(void *arg, unsigned char *rptr, unsigned char *obuf, +static int z_compress(void *arg, unsigned char *rptr, unsigned char *obuf, int isize, int osize) { struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; @@ -341,11 +340,10 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len) if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) return NULL; - state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc(sizeof(*state), GFP_KERNEL); if (state == NULL) return NULL; - memset (state, 0, sizeof (struct ppp_deflate_state)); state->w_size = w_size; state->strm.next_out = NULL; state->strm.workspace = kmalloc(zlib_inflate_workspacesize(), @@ -437,7 +435,7 @@ static void z_decomp_reset(void *arg) * bug, so we return DECOMP_FATALERROR for them in order to turn off * compression, even though they are detected by inspecting the input. */ -int z_decompress(void *arg, unsigned char *ibuf, int isize, +static int z_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf, int osize) { struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;