patch-2.1.2 linux/drivers/char/pty.c

Next file: linux/drivers/char/tty_io.c
Previous file: linux/drivers/char/pcxx.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.1/linux/drivers/char/pty.c linux/drivers/char/pty.c
@@ -123,6 +123,10 @@
 		down(&tmp_buf_sem);
 		temp_buffer = tmp_buf +
 			((tty->driver.subtype-1) * PTY_BUF_SIZE);
+		if (exception()) {
+			up(&tmp_buf_sem);
+			return -EFAULT;
+		}
 		while (count > 0) {
 			n = MIN(count, PTY_BUF_SIZE);
 			memcpy_fromfs(temp_buffer, buf, n);
@@ -134,6 +138,7 @@
 			buf += n;  c+= n;
 			count -= n;
 		}
+		end_exception();
 		up(&tmp_buf_sem);
 	} else {
 		c = MIN(count, to->ldisc.receive_room(to));

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