Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Oliver Neukum and committed by
Greg Kroah-Hartman
76cb03e7 8373856d

+1 -1
+1 -1
drivers/usb/class/cdc-wdm.c
··· 339 339 desc->werr = 0; 340 340 spin_unlock_irq(&desc->iuspin); 341 341 if (we < 0) 342 - return -EIO; 342 + return usb_translate_errors(we); 343 343 344 344 buf = kmalloc(count, GFP_KERNEL); 345 345 if (!buf) {