Skip to content

Commit

Permalink
USB: fix spinlock recursion in cdc-acm.c
Browse files Browse the repository at this point in the history
this fixes the spinlock recursion issue. The older fix was incomplete.


Signed-off-by: Oliver Neukum <oneukum@suse.de>
Acked-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Mar 10, 2007
1 parent 6454365 commit 834dbca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ static void acm_rx_tasklet(unsigned long _acm)
if (!ACM_READY(acm))
return;

spin_lock(&acm->throttle_lock);
spin_lock_irqsave(&acm->throttle_lock, flags);
throttled = acm->throttle;
spin_unlock(&acm->throttle_lock);
spin_unlock_irqrestore(&acm->throttle_lock, flags);
if (throttled)
return;

Expand All @@ -352,9 +352,9 @@ static void acm_rx_tasklet(unsigned long _acm)
dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size);

tty_buffer_request_room(tty, buf->size);
spin_lock(&acm->throttle_lock);
spin_lock_irqsave(&acm->throttle_lock, flags);
throttled = acm->throttle;
spin_unlock(&acm->throttle_lock);
spin_unlock_irqrestore(&acm->throttle_lock, flags);
if (!throttled)
tty_insert_flip_string(tty, buf->base, buf->size);
tty_flip_buffer_push(tty);
Expand Down

0 comments on commit 834dbca

Please sign in to comment.