]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
tty: amiserial: fix invalid user-pointer check
authorJohan Hovold <johan@kernel.org>
Tue, 8 Nov 2016 12:24:53 +0000 (13:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2016 13:41:25 +0000 (14:41 +0100)
Drop invalid user-pointer check from TIOCGSERIAL handler.

A NULL-pointer can be valid in user space and copy_to_user() takes care
of sanity checking.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/amiserial.c

index 208f573495dcab3efdad85fcbdcd32809102c192..dfbb974927f289095cccedb06d0d3db73dbfbdee 100644 (file)
@@ -1012,8 +1012,6 @@ static int get_serial_info(struct tty_struct *tty, struct serial_state *state,
 {
        struct serial_struct tmp;
    
-       if (!retinfo)
-               return -EFAULT;
        memset(&tmp, 0, sizeof(tmp));
        tty_lock(tty);
        tmp.line = tty->index;