patch-2.0.21 linux/drivers/char/random.c

Next file: linux/drivers/net/3c509.c
Previous file: linux/drivers/char/mem.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.20/linux/drivers/char/random.c linux/drivers/char/random.c
@@ -1002,6 +1002,8 @@
 		nbytes -= i;
 		buf += i;
 		add_timer_randomness(r, &extract_timer_state, nbytes);
+		if (to_user && need_resched)
+			schedule();
 	}
 
 	/* Wipe data from memory */
@@ -1229,7 +1231,7 @@
 			return -EINVAL;
 		size = get_user(p++);
 		retval = random_write(0, file, (const char *) p, size);
-		if (retval)
+		if (retval < 0)
 			return retval;
 		/*
 		 * Add ent_count to entropy_count, limiting the result to be

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov