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 <oneu...@suse.de>0
---
 drivers/usb/class/cdc-wdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 00871cf..21850a9 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -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) {
-- 
2.1.4

--
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

Reply via email to