USB: cdc-wdm: sanitize error returns
Oliver Neukum [Fri, 27 Apr 2012 12:23:54 +0000 (14:23 +0200)]
commit 24a85bae5da2b43fed423859c09c5a81ab359473 upstream.

wdm_flush() returns unsanitized USB error codes.
They must be cleaned up to before being anded to user space

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drivers/usb/class/cdc-wdm.c

index 0bb2b32..0209b46 100644 (file)
@@ -534,7 +534,7 @@ static int wdm_flush(struct file *file, fl_owner_t id)
                dev_err(&desc->intf->dev, "Error in flush path: %d\n",
                        desc->werr);
 
-       return desc->werr;
+       return usb_translate_errors(desc->werr);
 }
 
 static unsigned int wdm_poll(struct file *file, struct poll_table_struct *wait)