]> git.karo-electronics.de Git - linux-beck.git/commitdiff
tty: rocket: fix invalid user-pointer checks
authorJohan Hovold <johan@kernel.org>
Tue, 8 Nov 2016 12:24:54 +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 checks from custom ioctl handlers.

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/rocket.c

index b0cc47c77b40f79a49b637fafce9fa64914f234a..d66c1edd98926d5d410895ba8a39b1ed82d10340 100644 (file)
@@ -1189,8 +1189,6 @@ static int get_config(struct r_port *info, struct rocket_config __user *retinfo)
 {
        struct rocket_config tmp;
 
-       if (!retinfo)
-               return -EFAULT;
        memset(&tmp, 0, sizeof (tmp));
        mutex_lock(&info->port.mutex);
        tmp.line = info->line;
@@ -1255,8 +1253,6 @@ static int get_ports(struct r_port *info, struct rocket_ports __user *retports)
        struct rocket_ports tmp;
        int board;
 
-       if (!retports)
-               return -EFAULT;
        memset(&tmp, 0, sizeof (tmp));
        tmp.tty_major = rocket_driver->major;