[PATCH] hang on /dev/kmem

Hugh Dickins (hugh@veritas.com)
Fri, 27 Jul 2001 22:14:08 +0100 (BST)


read_kmem() gets stuck in silly loop after reading last vmalloc area.
Patch below against 2.4.8-pre1 or 2.4.7-ac1: please apply.

Hugh

--- linux-2.4.8-pre1/drivers/char/mem.c Wed Jul 11 00:07:46 2001
+++ linux/drivers/char/mem.c Fri Jul 27 21:40:05 2001
@@ -260,7 +260,9 @@
if (len > PAGE_SIZE)
len = PAGE_SIZE;
len = vread(kbuf, (char *)p, len);
- if (len && copy_to_user(buf, kbuf, len)) {
+ if (!len)
+ break;
+ if (copy_to_user(buf, kbuf, len)) {
free_page((unsigned long)kbuf);
return -EFAULT;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/