--- dahdi-linux-complete-2.2.0-rc4+2.2.0-rc2/linux/drivers/dahdi/dahdi-base.c 2009-05-01 23:43:18.000000000 +0700 +++ dahdi-linux-complete/linux/drivers/dahdi/dahdi-base.c 2009-06-02 11:21:49.192144086 +0700 @@ -552,12 +553,16 @@ static int dahdi_proc_read(char *page, char **start, off_t off, int count, int *eof, void *data) { - int x, len = 0; + int x, len = 0, real_count; long span; - /* In Linux 2.6, this MUST NOT EXECEED 1024 bytes in one read! */ + /* In Linux 2.6, page is always PROC_BLOCK_SIZE=(PAGE_SIZE-1024) bytes. + * 0 off + count) break; + /* stop if we're NEAR danger limit. let it be -128 bytes. */ + if (len > count-128) + break; } + count = real_count; /* If everything printed so far is before beginning of request */ if (len <= off) { - off -= len; + off = 0; len = 0; } *start = page + off;