diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-07 12:03:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-07 12:03:39 -0400 |
commit | 61906313bd41cde2f9aaa14e461e6108d3e71aaa (patch) | |
tree | c84805a9c67e3baf9e5acf13a3f55f7058a9131f /drivers/usb/class/cdc-wdm.c | |
parent | 3aa2ae74ba630ec9b98736d64aea8e4cb490861d (diff) | |
parent | d48b97b403d23f6df0b990cee652bdf9a52337a3 (diff) |
Merge 3.4-rc6 into usb-next
This resolves the conflict with:
drivers/usb/host/ehci-tegra.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class/cdc-wdm.c')
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index cd017a914c5d..5d151653ae43 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -157,8 +157,9 @@ static void wdm_out_callback(struct urb *urb) | |||
157 | spin_lock(&desc->iuspin); | 157 | spin_lock(&desc->iuspin); |
158 | desc->werr = urb->status; | 158 | desc->werr = urb->status; |
159 | spin_unlock(&desc->iuspin); | 159 | spin_unlock(&desc->iuspin); |
160 | clear_bit(WDM_IN_USE, &desc->flags); | ||
161 | kfree(desc->outbuf); | 160 | kfree(desc->outbuf); |
161 | desc->outbuf = NULL; | ||
162 | clear_bit(WDM_IN_USE, &desc->flags); | ||
162 | wake_up(&desc->wait); | 163 | wake_up(&desc->wait); |
163 | } | 164 | } |
164 | 165 | ||
@@ -338,7 +339,7 @@ static ssize_t wdm_write | |||
338 | if (we < 0) | 339 | if (we < 0) |
339 | return -EIO; | 340 | return -EIO; |
340 | 341 | ||
341 | desc->outbuf = buf = kmalloc(count, GFP_KERNEL); | 342 | buf = kmalloc(count, GFP_KERNEL); |
342 | if (!buf) { | 343 | if (!buf) { |
343 | rv = -ENOMEM; | 344 | rv = -ENOMEM; |
344 | goto outnl; | 345 | goto outnl; |
@@ -408,10 +409,12 @@ static ssize_t wdm_write | |||
408 | req->wIndex = desc->inum; | 409 | req->wIndex = desc->inum; |
409 | req->wLength = cpu_to_le16(count); | 410 | req->wLength = cpu_to_le16(count); |
410 | set_bit(WDM_IN_USE, &desc->flags); | 411 | set_bit(WDM_IN_USE, &desc->flags); |
412 | desc->outbuf = buf; | ||
411 | 413 | ||
412 | rv = usb_submit_urb(desc->command, GFP_KERNEL); | 414 | rv = usb_submit_urb(desc->command, GFP_KERNEL); |
413 | if (rv < 0) { | 415 | if (rv < 0) { |
414 | kfree(buf); | 416 | kfree(buf); |
417 | desc->outbuf = NULL; | ||
415 | clear_bit(WDM_IN_USE, &desc->flags); | 418 | clear_bit(WDM_IN_USE, &desc->flags); |
416 | dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv); | 419 | dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv); |
417 | rv = usb_translate_errors(rv); | 420 | rv = usb_translate_errors(rv); |