From: Johan Hovold Date: Tue, 8 Nov 2016 12:28:23 +0000 (+0100) Subject: USB: cdc-acm: fix invalid user-pointer check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=04cbf3832bbe21ac473e6b79571fce0c7f10a087;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git USB: cdc-acm: fix invalid user-pointer check 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 Acked-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 78f0f85bebdc..5535377f540e 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -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;