cdc-wdm: return correct error codes

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>
This commit is contained in:
Oliver Neukum 2015-03-20 14:28:56 +01:00 committed by Greg Kroah-Hartman
parent 8373856d94
commit 76cb03e7d5
1 changed files with 1 additions and 1 deletions

View File

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