]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
serial: crisv10: fix invalid user-pointer check
authorJohan Hovold <johan@kernel.org>
Tue, 8 Nov 2016 12:24:55 +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.

Cc: Mikael Starvik <starvik@axis.com>
Cc: linux-cris-kernel@axis.com
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/crisv10.c

index 6450a38cb1aa3583dfb604cdd56fda2c45041bdc..e92c23470e519f839693ca2d486e3aaf2d368854 100644 (file)
@@ -3213,8 +3213,6 @@ get_serial_info(struct e100_serial * info,
         * should set them to something else than 0.
         */
 
-       if (!retinfo)
-               return -EFAULT;
        memset(&tmp, 0, sizeof(tmp));
        tmp.type = info->type;
        tmp.line = info->line;