]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
USB: cdc-acm: fix TIOCMIWAIT
authorJohan Hovold <johan@kernel.org>
Tue, 8 Nov 2016 12:10:57 +0000 (13:10 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:54:32 +0000 (03:54 +0000)
commit 18266403f3fe507f0246faa1d5432333a2f139ca upstream.

The TIOCMIWAIT implementation would return -EINVAL if any of the three
supported signals were included in the mask.

Instead of returning an error in case TIOCM_CTS is included, simply
drop the mask check completely, which is in accordance with how other
drivers implement this ioctl.

Fixes: 5a6a62bdb925 ("cdc-acm: add TIOCMIWAIT")
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/class/cdc-acm.c

index 73b3b054771f9c7313e4a1f2a4db5063e7a97ba6..8c779ee044d8fea200941b97e293bc15eab6b2ce 100644 (file)
@@ -867,8 +867,6 @@ static int wait_serial_change(struct acm *acm, unsigned long arg)
        DECLARE_WAITQUEUE(wait, current);
        struct async_icount old, new;
 
-       if (arg & (TIOCM_DSR | TIOCM_RI | TIOCM_CD ))
-               return -EINVAL;
        do {
                spin_lock_irq(&acm->read_lock);
                old = acm->oldcount;