From: Oliver Neukum Date: Fri, 20 Mar 2015 13:28:56 +0000 (+0100) Subject: cdc-wdm: return correct error codes X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=76cb03e7d5d7ba49175784dce961696da66c44cc;p=openwrt%2Fstaging%2Fblogic.git 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 0 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index a051a7a2b1bd..f053b41fae7f 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) {