USB: cdc-acm: fix invalid user-pointer check
authorJohan Hovold <johan@kernel.org>
Tue, 8 Nov 2016 12:28:23 +0000 (13:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2016 12:16:57 +0000 (13:16 +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>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c

index 78f0f85bebdc25ef971405175feb621865f4cad1..5535377f540eced25ba6c26ea1c432a4abb57a11 100644 (file)
@@ -877,9 +877,6 @@ static int get_serial_info(struct acm *acm, struct serial_struct __user *info)
 {
        struct serial_struct tmp;
 
-       if (!info)
-               return -EINVAL;
-
        memset(&tmp, 0, sizeof(tmp));
        tmp.flags = ASYNC_LOW_LATENCY;
        tmp.xmit_fifo_size = acm->writesize;