Skip to content

Commit

Permalink
cdc-wdm: return correct error codes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Mar 26, 2015
1 parent 8373856 commit 76cb03e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/class/cdc-wdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 76cb03e

Please sign in to comment.