Re: Oops in 2.1.28... (while stress testing :-)

Jan Kratochvil (short@k332.feld.cvut.cz)
Mon, 10 Mar 1997 17:00:06 +0100 (MET)


Hi!

Follows the patch to prevent exceptions when reading /proc/misc:

P.S.: Although I know about default `make' dependencies (.o: .c),
I need to explicitly include .c for each .o to `.depend' files to
get things to work... Weird (GNU make 3.72.1)

--- linux/drivers/char/misc.c-2.1.28 Mon Feb 3 10:16:59 1997
+++ linux/drivers/char/misc.c Sat Mar 8 16:46:22 1997
@@ -79,9 +79,10 @@
struct miscdevice *p;

len=0;
- for (p = misc_list.next; p != &misc_list; p = p->next)
+ for (p = misc_list.next; p != &misc_list && len < 4000; p = p->next)
len += sprintf(buf+len, "%3i %s\n",p->minor, p->name ?: "");
- return len;
+ *start = buf + offset;
+ return len > offset ? len - offset : 0;
}

#endif /* PROC_FS */