patch-2.1.6 linux/drivers/isdn/isdn_tty.c

Next file: linux/drivers/isdn/teles/callc.c
Previous file: linux/drivers/isdn/isdn_ppp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.5/linux/drivers/isdn/isdn_tty.c linux/drivers/isdn/isdn_tty.c
@@ -1013,8 +1013,7 @@
 	status = info->lsr;
 	restore_flags(flags);
 	result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0);
-	put_user(result, (ulong *) value);
-	return 0;
+	return put_user(result, (ulong *) value);
 }
 
 
@@ -1035,14 +1034,18 @@
 	    | ((status & UART_MSR_RI) ? TIOCM_RNG : 0)
 	    | ((status & UART_MSR_DSR) ? TIOCM_DSR : 0)
 	    | ((status & UART_MSR_CTS) ? TIOCM_CTS : 0);
-	put_user(result, (ulong *) value);
-	return 0;
+	return put_user(result, (ulong *) value);
 }
 
 static int isdn_tty_set_modem_info(modem_info * info, uint cmd, uint * value)
 {
-	uint arg = get_user((uint *) value);
-        int pre_dtr;
+	uint arg;
+    int pre_dtr;
+	int error;
+
+	error = get_user(arg, ((uint *) value));
+	if (error)
+	        return error;
 
 	switch (cmd) {
                 case TIOCMBIS:
@@ -1140,19 +1143,17 @@
 #ifdef ISDN_DEBUG_MODEM_IOCTL
                         printk(KERN_DEBUG "ttyI%d ioctl TIOCGSOFTCAR\n", info->line);
 #endif
-                        error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(long));
-                        if (error)
-                                return error;
-                        put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg);
+                        error = put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg);
+						if (error)
+							    return error;
                         return 0;
                 case TIOCSSOFTCAR:
 #ifdef ISDN_DEBUG_MODEM_IOCTL
                         printk(KERN_DEBUG "ttyI%d ioctl TIOCSSOFTCAR\n", info->line);
 #endif
-                        error = verify_area(VERIFY_READ, (void *) arg, sizeof(long));
-                        if (error)
-                                return error;
-                        arg = get_user((ulong *) arg);
+                        error = get_user(arg ,((ulong *) arg));
+						if (error)
+							    return error;
                         tty->termios->c_cflag =
                                 ((tty->termios->c_cflag & ~CLOCAL) |
                                  (arg ? CLOCAL : 0));
@@ -1161,26 +1162,16 @@
 #ifdef ISDN_DEBUG_MODEM_IOCTL
                         printk(KERN_DEBUG "ttyI%d ioctl TIOCMGET\n", info->line);
 #endif
-                        error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(uint));
-                        if (error)
-                                return error;
                         return isdn_tty_get_modem_info(info, (uint *) arg);
                 case TIOCMBIS:
                 case TIOCMBIC:
                 case TIOCMSET:
-                        error = verify_area(VERIFY_READ, (void *) arg, sizeof(uint));
-                        if (error)
-                                return error;
                         return isdn_tty_set_modem_info(info, cmd, (uint *) arg);
                 case TIOCSERGETLSR:	/* Get line status register */
 #ifdef ISDN_DEBUG_MODEM_IOCTL
                         printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line);
 #endif
-                        error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(uint));
-                        if (error)
-                                return error;
-                        else
-                                return isdn_tty_get_lsr_info(info, (uint *) arg);
+                        return isdn_tty_get_lsr_info(info, (uint *) arg);
                         
                 default:
 #ifdef ISDN_DEBUG_MODEM_IOCTL
@@ -2670,7 +2661,7 @@
 
 	for (cnt = count; cnt > 0; p++, cnt--) {
 		if (user)
-			c = get_user(p);
+		    get_user(c, p);
 		else
 			c = *p;
 		total++;

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