]> err.no Git - linux-2.6/commitdiff
USB: fix spinlock recursion in cdc-acm.c
authorOliver Neukum <oneukum@suse.de>
Tue, 6 Mar 2007 09:47:04 +0000 (10:47 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 10 Mar 2007 03:52:25 +0000 (19:52 -0800)
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>
drivers/usb/class/cdc-acm.c

index d38a25f36ea5839557b0328cd72940962d2d0dda..31ae661e586ad21731b58092146277fe0e0c99bb 100644 (file)
@@ -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;
 
@@ -352,9 +352,9 @@ next_buffer:
        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);