lkml.org 
[lkml]   [1996]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject2.0.0 crashes solved [patch]
Date
From
Hello all,

some weeks ago, I reported some crashes with the new 2.0 kernel
at our IPS's server machine.
The machine is doing heavy ppp/[c]slip work and never had an uptime over
10 hours due to the crashes.
After reporting these problems, Jon Lewis <jlewis@inorganic5.fdt.net>
send me a patch for slhc.c which solved the problem.
(the patch was for 1.2.13 but worked fine in 2.0)

The machine is now up 5 days, 6:34 and i think it's time for a success
report.

If you have problems on a machine doing [c]slip/ppp resulting in
crashes you should try out this patch:

--- linux/drivers/net/slhc.c.orig Sat Jun 15 11:34:26 1996
+++ linux/drivers/net/slhc.c Sat Jun 15 11:36:32 1996
@@ -107,29 +107,27 @@
memset(comp, 0, sizeof(struct slcompress));

if ( rslots > 0 && rslots < 256 ) {
- comp->rstate =
- (struct cstate *)kmalloc(rslots * sizeof(struct cstate),
- GFP_KERNEL);
+ size_t rsize = rslots * sizeof(struct cstate);
+ comp->rstate = (struct cstate *) kmalloc(rsize, GFP_KERNEL);
if (! comp->rstate)
{
kfree((unsigned char *)comp);
return NULL;
}
- memset(comp->rstate, 0, rslots * sizeof(struct cstate));
+ memset(comp->rstate, 0, rsize);
comp->rslot_limit = rslots - 1;
}

if ( tslots > 0 && tslots < 256 ) {
- comp->tstate =
- (struct cstate *)kmalloc(tslots * sizeof(struct cstate),
- GFP_KERNEL);
+ size_t tsize = tslots * sizeof(struct cstate);
+ comp->tstate = (struct cstate *) kmalloc(tsize, GFP_KERNEL);
if (! comp->tstate)
{
kfree((unsigned char *)comp->rstate);
kfree((unsigned char *)comp);
return NULL;
}
- memset(comp->tstate, 0, tslots * sizeof(struct cstate));
+ memset(comp->tstate, 0, tsize);
comp->tslot_limit = tslots - 1;
}

end of patch
regards,

-Michael

--
x(f,s,c)char *s;{return f&1 ? *s ? *s-c ? x(f,++s,c) :7[s]:0:f&2
? x(--f,"!/*,xq-ih9]c$=le&M t)r\nm@p31n%ag.8}Sdoy",c):f&4 ? *s ?
x(f,s+1,putchar(x(f-2,"^&%!*)",*s))) : 0 : 0;}main(){return x(4,
"]!x/mhicn$!iihle&!x/mhiM$agimr%p !r@p%he&!x/mhiM !r@p%he",65);}



\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.061 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site