staging: vt6656: lock changes: s_nsBulkInUsbIoCompleteRead.
authorMalcolm Priestley <tvboxspy@gmail.com>
Thu, 15 May 2014 21:49:20 +0000 (22:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 May 2014 22:02:19 +0000 (15:02 -0700)
Use spin_lock_irqsave/spin_unlock_irqrestore

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/usbpipe.c

index 934d0a92363b0e939ecbe062b16edb4b3a5cccea..b707470143af9bb113293f9f9bc4c2f69c7b3322 100644 (file)
@@ -474,6 +474,7 @@ static void s_nsBulkInUsbIoCompleteRead(struct urb *urb)
 {
        struct vnt_rcb *rcb = urb->context;
        struct vnt_private *priv = rcb->pDevice;
+       unsigned long flags;
        int re_alloc_skb = false;
 
        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsBulkInUsbIoCompleteRead\n");
@@ -493,23 +494,23 @@ static void s_nsBulkInUsbIoCompleteRead(struct urb *urb)
        }
 
        if (urb->actual_length) {
-               spin_lock(&priv->lock);
+               spin_lock_irqsave(&priv->lock, flags);
 
                if (RXbBulkInProcessData(priv, rcb, urb->actual_length) == true)
                        re_alloc_skb = true;
 
-               spin_unlock(&priv->lock);
+               spin_unlock_irqrestore(&priv->lock, flags);
        }
 
        rcb->Ref--;
        if (rcb->Ref == 0) {
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RxvFreeNormal %d\n",
                                                        priv->NumRecvFreeList);
-               spin_lock(&priv->lock);
+               spin_lock_irqsave(&priv->lock, flags);
 
                RXvFreeRCB(rcb, re_alloc_skb);
 
-               spin_unlock(&priv->lock);
+               spin_unlock_irqrestore(&priv->lock, flags);
        }
 
        return;