Commit e02f27ca authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] janitor: rio_linux: user get/put_user for errors (not

From: Domen Puncer <domen@coderock.org>
parent acf658db
...@@ -689,9 +689,7 @@ static int rio_ioctl (struct tty_struct * tty, struct file * filp, ...@@ -689,9 +689,7 @@ static int rio_ioctl (struct tty_struct * tty, struct file * filp,
break; break;
#endif #endif
case TIOCSSOFTCAR: case TIOCSSOFTCAR:
if ((rc = verify_area(VERIFY_READ, (void *) arg, if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(int))) == 0) {
get_user(ival, (unsigned int *) arg);
tty->termios->c_cflag = tty->termios->c_cflag =
(tty->termios->c_cflag & ~CLOCAL) | (tty->termios->c_cflag & ~CLOCAL) |
(ival ? CLOCAL : 0); (ival ? CLOCAL : 0);
...@@ -741,25 +739,19 @@ static int rio_ioctl (struct tty_struct * tty, struct file * filp, ...@@ -741,25 +739,19 @@ static int rio_ioctl (struct tty_struct * tty, struct file * filp,
} }
break; break;
case TIOCMBIS: case TIOCMBIS:
if ((rc = verify_area(VERIFY_READ, (void *) arg, if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1), rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1),
((ival & TIOCM_RTS) ? 1 : -1)); ((ival & TIOCM_RTS) ? 1 : -1));
} }
break; break;
case TIOCMBIC: case TIOCMBIC:
if ((rc = verify_area(VERIFY_READ, (void *) arg, if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
rio_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1), rio_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1),
((ival & TIOCM_RTS) ? 0 : -1)); ((ival & TIOCM_RTS) ? 0 : -1));
} }
break; break;
case TIOCMSET: case TIOCMSET:
if ((rc = verify_area(VERIFY_READ, (void *) arg, if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0), rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0),
((ival & TIOCM_RTS) ? 1 : 0)); ((ival & TIOCM_RTS) ? 1 : 0));
} }
...@@ -1010,9 +1002,9 @@ static int rio_init_datastructures (void) ...@@ -1010,9 +1002,9 @@ static int rio_init_datastructures (void)
free6:for (i--;i>=0;i--) free6:for (i--;i>=0;i--)
kfree (p->RIOPortp[i]); kfree (p->RIOPortp[i]);
/*free5: */ /*free5:
free4: free4:
free3:kfree (p->RIOPortp); free3:*/kfree (p->RIOPortp);
free2:kfree (p->RIOHosts); free2:kfree (p->RIOHosts);
free1: free1:
rio_dprintk (RIO_DEBUG_INIT, "Not enough memory! %p %p %p\n", rio_dprintk (RIO_DEBUG_INIT, "Not enough memory! %p %p %p\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment