Commit 12a98b2b authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

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: default avatarOliver Neukum <oneukum@suse.de>
Tested-by: default avatarBjørn Mork <bjorn@mork.no>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 880bca3a
...@@ -368,6 +368,7 @@ static ssize_t wdm_write ...@@ -368,6 +368,7 @@ static ssize_t wdm_write
r = usb_autopm_get_interface(desc->intf); r = usb_autopm_get_interface(desc->intf);
if (r < 0) { if (r < 0) {
kfree(buf); kfree(buf);
rv = usb_translate_errors(r);
goto outnp; goto outnp;
} }
...@@ -383,6 +384,7 @@ static ssize_t wdm_write ...@@ -383,6 +384,7 @@ static ssize_t wdm_write
if (r < 0) { if (r < 0) {
kfree(buf); kfree(buf);
rv = r;
goto out; goto out;
} }
...@@ -412,6 +414,7 @@ static ssize_t wdm_write ...@@ -412,6 +414,7 @@ static ssize_t wdm_write
kfree(buf); kfree(buf);
clear_bit(WDM_IN_USE, &desc->flags); clear_bit(WDM_IN_USE, &desc->flags);
dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv); dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv);
rv = usb_translate_errors(rv);
} else { } else {
dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d", dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d",
req->wIndex); req->wIndex);
...@@ -593,6 +596,7 @@ static int wdm_open(struct inode *inode, struct file *file) ...@@ -593,6 +596,7 @@ static int wdm_open(struct inode *inode, struct file *file)
desc->count--; desc->count--;
dev_err(&desc->intf->dev, dev_err(&desc->intf->dev,
"Error submitting int urb - %d\n", rv); "Error submitting int urb - %d\n", rv);
rv = usb_translate_errors(rv);
} }
} else { } else {
rv = 0; rv = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment