From 24a85bae5da2b43fed423859c09c5a81ab359473 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Fri, 27 Apr 2012 14:23:54 +0200 Subject: [PATCH] USB: cdc-wdm: sanitize error returns wdm_flush() returns unsanitized USB error codes. They must be cleaned up to before being anded to user space Signed-off-by: Oliver Neukum Cc: stable 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 c6f6560d436c..b29a9815e4d2 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -531,7 +531,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) -- 2.39.5