X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fsx.c;h=643163b08a8fdc7c52d05a0d205b3bc4eeb90852;hb=5d0dd51ddb446e7c058023420f5b7d4404501980;hp=1ca3d2543d75ef540e404f204af982dfd06b8621;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/drivers/char/sx.c b/drivers/char/sx.c index 1ca3d2543..643163b08 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c @@ -251,13 +251,11 @@ #define PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8 0x2000 #endif -#ifdef CONFIG_PCI static struct pci_device_id sx_pci_tbl[] = { { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, PCI_ANY_ID, PCI_ANY_ID }, { 0 } }; MODULE_DEVICE_TABLE(pci, sx_pci_tbl); -#endif /* CONFIG_PCI */ /* Configurable options: (Don't be too sure that it'll work if you toggle them) */ @@ -1594,8 +1592,7 @@ static int sx_fw_ioctl (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { int rc = 0; - int __user *descr = (int __user *)arg; - int i; + int *descr = (int *)arg, i; static struct sx_board *board = NULL; int nbytes, offset; unsigned long data; @@ -1671,7 +1668,7 @@ static int sx_fw_ioctl (struct inode *inode, struct file *filp, get_user (data, descr++); while (nbytes && data) { for (i=0;i nbytes) ? nbytes - i : SX_CHUNK_SIZE)) { @@ -1777,7 +1774,6 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp, { int rc; struct sx_port *port = tty->driver_data; - void __user *argp = (void __user *)arg; int ival; /* func_enter2(); */ @@ -1786,20 +1782,24 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp, switch (cmd) { case TIOCGSOFTCAR: rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0), - (unsigned __user *) argp); + (unsigned int *) arg); break; case TIOCSSOFTCAR: - if ((rc = get_user(ival, (unsigned __user *) argp)) == 0) { + if ((rc = get_user(ival, (unsigned int *) arg)) == 0) { tty->termios->c_cflag = (tty->termios->c_cflag & ~CLOCAL) | (ival ? CLOCAL : 0); } break; case TIOCGSERIAL: - rc = gs_getserial(&port->gs, argp); + if ((rc = verify_area(VERIFY_WRITE, (void *) arg, + sizeof(struct serial_struct))) == 0) + rc = gs_getserial(&port->gs, (struct serial_struct *) arg); break; case TIOCSSERIAL: - rc = gs_setserial(&port->gs, argp); + if ((rc = verify_area(VERIFY_READ, (void *) arg, + sizeof(struct serial_struct))) == 0) + rc = gs_setserial(&port->gs, (struct serial_struct *) arg); break; default: rc = -ENOIOCTLCMD;