patch-2.4.7 linux/drivers/char/dz.c
Next file: linux/drivers/char/esp.c
Previous file: linux/drivers/char/dtlk.c
Back to the patch index
Back to the overall index
- Lines: 87
- Date:
Wed Jul 4 14:41:33 2001
- Orig file:
v2.4.6/linux/drivers/char/dz.c
- Orig date:
Fri Mar 2 18:38:37 2001
diff -u --recursive --new-file v2.4.6/linux/drivers/char/dz.c linux/drivers/char/dz.c
@@ -14,6 +14,8 @@
* after patches by harald to irq code.
* [09-JAN-99] triemer minor fix for schedule - due to removal of timeout
* field from "current" - somewhere between 2.1.121 and 2.1.131
+Qua Jun 27 15:02:26 BRT 2001
+ * [27-JUN-2001] Arnaldo Carvalho de Melo <acme@conectiva.com.br> - cleanups
*
* Parts (C) 1999 David Airlie, airlied@linux.ie
* [07-SEP-99] Bugfixes
@@ -835,7 +837,7 @@
tmp.close_delay = info->close_delay;
tmp.closing_wait = info->closing_wait;
- return copy_to_user (retinfo, &tmp, sizeof(*retinfo));
+ return copy_to_user(retinfo, &tmp, sizeof(*retinfo)) ? -EFAULT : 0;
}
static int set_serial_info (struct dz_serial *info, struct serial_struct *new_info)
@@ -919,9 +921,9 @@
restore_flags (flags);
}
-static int dz_ioctl (struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg)
+static int dz_ioctl (struct tty_struct *tty, struct file *file,
+ unsigned int cmd, unsigned long arg)
{
- int error;
struct dz_serial * info = (struct dz_serial *)tty->driver_data;
int retval;
@@ -951,41 +953,26 @@
return 0;
case TIOCGSOFTCAR:
- error = verify_area (VERIFY_WRITE, (void *)arg, sizeof(long));
- if (error)
- return error;
- put_user (C_CLOCAL(tty) ? 1 : 0, (unsigned long *)arg);
- return 0;
+ return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *)arg);
case TIOCSSOFTCAR:
- error = get_user (arg, (unsigned long *)arg);
- if (error)
- return error;
+ if (get_user (arg, (unsigned long *)arg))
+ return -EFAULT;
tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0));
return 0;
case TIOCGSERIAL:
- error = verify_area (VERIFY_WRITE, (void *)arg, sizeof(struct serial_struct));
- if (error)
- return error;
return get_serial_info (info, (struct serial_struct *)arg);
case TIOCSSERIAL:
return set_serial_info (info, (struct serial_struct *) arg);
case TIOCSERGETLSR: /* Get line status register */
- error = verify_area (VERIFY_WRITE, (void *)arg, sizeof(unsigned int));
- if (error)
- return error;
- else
- return get_lsr_info (info, (unsigned int *)arg);
+ return get_lsr_info (info, (unsigned int *)arg);
case TIOCSERGSTRUCT:
- error = verify_area (VERIFY_WRITE, (void *)arg, sizeof(struct dz_serial));
- if (error)
- return error;
- copy_to_user((struct dz_serial *)arg, info, sizeof(struct dz_serial));
- return 0;
+ return copy_to_user((struct dz_serial *)arg, info,
+ sizeof(struct dz_serial)) ? -EFAULT : 0;
default:
return -ENOIOCTLCMD;
@@ -1436,7 +1423,7 @@
* dz_console_print ()
*
* dz_console_print is registered for printk.
- * The console_lock must be held when we get here.
+ * The console must be locked when we get here.
* -------------------------------------------------------------------
*/
static void dz_console_print (struct console *cons,
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)