diff -urN linux/drivers/char/mem.c kmem/drivers/char/mem.c
--- linux/drivers/char/mem.c Thu Dec 16 21:59:38 1999
+++ kmem/drivers/char/mem.c Wed Dec 29 13:43:38 1999
@@ -238,14 +238,16 @@
if (p < PAGE_SIZE && read > 0) {
size_t tmp = PAGE_SIZE - p;
if (tmp > read) tmp = read;
- clear_user(buf, tmp);
+ if (clear_user(buf, tmp))
+ return -EFAULT;
buf += tmp;
p += tmp;
read -= tmp;
count -= tmp;
}
#endif
- copy_to_user(buf, (char *)p, read);
+ if (copy_to_user(buf, (char *)p, read))
+ return -EFAULT;
p += read;
buf += read;
count -= read;