cdc-wdm: return correct error codes
authorOliver Neukum <oneukum@suse.de>
Fri, 20 Mar 2015 13:28:56 +0000 (14:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 09:50:52 +0000 (10:50 +0100)
Lieing to user space is wrong. The real reason for a failure
to write should be returned to user space.

Signed-off-by: Oliver Neukum <oneukum@suse.de>0
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-wdm.c

index a051a7a2b1bd534a93fd459da7c553e0a5af4dfa..f053b41fae7f2ae79ded3a2e2908836dd2f3607c 100644 (file)
@@ -339,7 +339,7 @@ static ssize_t wdm_write
        desc->werr = 0;
        spin_unlock_irq(&desc->iuspin);
        if (we < 0)
-               return -EIO;
+               return usb_translate_errors(we);
 
        buf = kmalloc(count, GFP_KERNEL);
        if (!buf) {