[PATCH 1/2] USB: cdc-acm: fix invalid user-pointer check

2016-11-08 Thread Johan Hovold
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 
---
 drivers/usb/class/cdc-acm.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index c2da3811915a..b501abe4b76d 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;
-- 
2.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] USB: cdc-acm: fix invalid user-pointer check

2016-11-09 Thread Oliver Neukum
On Tue, 2016-11-08 at 13:28 +0100, Johan Hovold wrote:
> 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 

Regards
Oliver


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html