X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fnet%2Fslhc.c;h=0adab709ab68ecdfa2c56dc0367736681369b2ea;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=c6fbb1ede0ed23e66dbd6a1941a145689622cef6;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c index c6fbb1ede..0adab709a 100644 --- a/drivers/net/slhc.c +++ b/drivers/net/slhc.c @@ -42,7 +42,7 @@ * Modularization. * - Jan 1995 Bjorn Ekwall * Use ip_fast_csum from ip.h - * - July 1995 Christos A. Polyzols + * - July 1995 Christos A. Polyzols * Spotted bug in tcp option checking * * @@ -50,7 +50,6 @@ * driver code belonging close to PPP and SLIP */ -#include #include #include #include @@ -95,27 +94,23 @@ slhc_init(int rslots, int tslots) register struct cstate *ts; struct slcompress *comp; - comp = (struct slcompress *)kmalloc(sizeof(struct slcompress), - GFP_KERNEL); + comp = kzalloc(sizeof(struct slcompress), GFP_KERNEL); if (! comp) goto out_fail; - memset(comp, 0, sizeof(struct slcompress)); if ( rslots > 0 && rslots < 256 ) { size_t rsize = rslots * sizeof(struct cstate); - comp->rstate = (struct cstate *) kmalloc(rsize, GFP_KERNEL); + comp->rstate = kzalloc(rsize, GFP_KERNEL); if (! comp->rstate) goto out_free; - memset(comp->rstate, 0, rsize); comp->rslot_limit = rslots - 1; } if ( tslots > 0 && tslots < 256 ) { size_t tsize = tslots * sizeof(struct cstate); - comp->tstate = (struct cstate *) kmalloc(tsize, GFP_KERNEL); + comp->tstate = kzalloc(tsize, GFP_KERNEL); if (! comp->tstate) goto out_free2; - memset(comp->tstate, 0, tsize); comp->tslot_limit = tslots - 1; } @@ -142,9 +137,9 @@ slhc_init(int rslots, int tslots) return comp; out_free2: - kfree((unsigned char *)comp->rstate); + kfree(comp->rstate); out_free: - kfree((unsigned char *)comp); + kfree(comp); out_fail: return NULL; } @@ -243,10 +238,10 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, /* * Don't play with runt packets. */ - + if(isize