diff options
author | Paul Mackerras <paulus@samba.org> | 2008-11-19 16:10:32 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-11-19 16:10:32 +1100 |
commit | cea555d384b85271035814c5adad23e6c7fc5d2a (patch) | |
tree | 1181b6333a69a135293ec75f8a48c849ee32c015 /drivers/usb/class/cdc-acm.c | |
parent | 78608dd32ce46789e970d6c3c423cd668c138d6c (diff) | |
parent | 7f0f598a0069d1ab072375965a4b69137233169c (diff) | |
download | blackbird-op-linux-cea555d384b85271035814c5adad23e6c7fc5d2a.tar.gz blackbird-op-linux-cea555d384b85271035814c5adad23e6c7fc5d2a.zip |
Merge branch 'linux-2.6' into next
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 20104443081a..d50a99f70aee 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -158,16 +158,12 @@ static int acm_wb_is_avail(struct acm *acm) } /* - * Finish write. + * Finish write. Caller must hold acm->write_lock */ static void acm_write_done(struct acm *acm, struct acm_wb *wb) { - unsigned long flags; - - spin_lock_irqsave(&acm->write_lock, flags); wb->use = 0; acm->transmitting--; - spin_unlock_irqrestore(&acm->write_lock, flags); } /* @@ -482,6 +478,7 @@ static void acm_write_bulk(struct urb *urb) { struct acm_wb *wb = urb->context; struct acm *acm = wb->instance; + unsigned long flags; if (verbose || urb->status || (urb->actual_length != urb->transfer_buffer_length)) @@ -490,7 +487,9 @@ static void acm_write_bulk(struct urb *urb) urb->transfer_buffer_length, urb->status); + spin_lock_irqsave(&acm->write_lock, flags); acm_write_done(acm, wb); + spin_unlock_irqrestore(&acm->write_lock, flags); if (ACM_READY(acm)) schedule_work(&acm->work); else |