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:
parent
8373856d94
commit
76cb03e7d5
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue