From 76cb03e7d5d7ba49175784dce961696da66c44cc Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Fri, 20 Mar 2015 14:28:56 +0100 Subject: [PATCH] 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 --- drivers/usb/class/cdc-wdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.45.2