patch-2.1.14 linux/drivers/sbus/char/sunserial.c

Next file: linux/drivers/scsi/BusLogic.c
Previous file: linux/drivers/net/wavelan.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.13/linux/drivers/sbus/char/sunserial.c linux/drivers/sbus/char/sunserial.c
@@ -1365,17 +1365,18 @@
 			send_break(info, arg ? arg*(HZ/10) : HZ/4);
 			return 0;
 		case TIOCGSOFTCAR:
-			error = verify_area(VERIFY_WRITE, (void *) arg,sizeof(long));
-			if (error)
-				return error;
-			put_fs_long(C_CLOCAL(tty) ? 1 : 0,
-				    (unsigned long *) arg);
-			return 0;
+			return put_user(C_CLOCAL(tty) ? 1 : 0,
+			    (unsigned int *) arg);
 		case TIOCSSOFTCAR:
-			arg = get_fs_long((unsigned long *) arg);
-			tty->termios->c_cflag =
-				((tty->termios->c_cflag & ~CLOCAL) |
-				 (arg ? CLOCAL : 0));
+			{
+			    unsigned int value;
+			    retval = get_user(value, (unsigned int *) arg);
+			    if (retval)
+				return retval;
+			    tty->termios->c_cflag =
+				    ((tty->termios->c_cflag & ~CLOCAL) |
+				     (value ? CLOCAL : 0));
+			}
 			return 0;
 		case TIOCGSERIAL:
 			error = verify_area(VERIFY_WRITE, (void *) arg,

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