diff options
author | Oliver Neukum <oliver@neukum.org> | 2012-04-30 03:57:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-30 09:58:56 -0400 |
commit | 12a98b2bd8050b3cf28b50da612c484cdf174368 (patch) | |
tree | b43abd0b435a3f08d329a853aa5741f300a9de89 /drivers/usb/class | |
parent | 880bca3a2a6f159d7453e0cbcbfe2f1d8204d907 (diff) |
USB: cdc-wdm: cleanup error codes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The internal error codes returned in the write() code
path cannot be simply passed on to user space.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Tested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 4e8451ca2d6c..cd017a914c5d 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -368,6 +368,7 @@ static ssize_t wdm_write | |||
368 | r = usb_autopm_get_interface(desc->intf); | 368 | r = usb_autopm_get_interface(desc->intf); |
369 | if (r < 0) { | 369 | if (r < 0) { |
370 | kfree(buf); | 370 | kfree(buf); |
371 | rv = usb_translate_errors(r); | ||
371 | goto outnp; | 372 | goto outnp; |
372 | } | 373 | } |
373 | 374 | ||
@@ -383,6 +384,7 @@ static ssize_t wdm_write | |||
383 | 384 | ||
384 | if (r < 0) { | 385 | if (r < 0) { |
385 | kfree(buf); | 386 | kfree(buf); |
387 | rv = r; | ||
386 | goto out; | 388 | goto out; |
387 | } | 389 | } |
388 | 390 | ||
@@ -412,6 +414,7 @@ static ssize_t wdm_write | |||
412 | kfree(buf); | 414 | kfree(buf); |
413 | clear_bit(WDM_IN_USE, &desc->flags); | 415 | clear_bit(WDM_IN_USE, &desc->flags); |
414 | dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv); | 416 | dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv); |
417 | rv = usb_translate_errors(rv); | ||
415 | } else { | 418 | } else { |
416 | dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d", | 419 | dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d", |
417 | req->wIndex); | 420 | req->wIndex); |
@@ -593,6 +596,7 @@ static int wdm_open(struct inode *inode, struct file *file) | |||
593 | desc->count--; | 596 | desc->count--; |
594 | dev_err(&desc->intf->dev, | 597 | dev_err(&desc->intf->dev, |
595 | "Error submitting int urb - %d\n", rv); | 598 | "Error submitting int urb - %d\n", rv); |
599 | rv = usb_translate_errors(rv); | ||
596 | } | 600 | } |
597 | } else { | 601 | } else { |
598 | rv = 0; | 602 | rv = 0; |