]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
isdn/gigaset: bas_gigaset locking fix
authorTilman Schmidt <tilman@imap.cc>
Thu, 30 Sep 2010 13:34:30 +0000 (13:34 +0000)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:02 +0000 (23:40 +0100)
commit b33ffa5cbf52ee751bb8068218ebb3c742c5a515 upstream.

Unlock cs->lock before calling error_hangup() which is marked
"cs->lock must not be held".

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/isdn/gigaset/bas-gigaset.c

index b25f01e893db15b2c5c513b61879f2a54d8fd092..fef5e7559434d029435194630461c06682bf38b4 100644 (file)
@@ -1599,13 +1599,13 @@ static int gigaset_init_bchannel(struct bc_state *bcs)
 
        ret = starturbs(bcs);
        if (ret < 0) {
+               spin_unlock_irqrestore(&cs->lock, flags);
                dev_err(cs->dev,
                        "could not start isochronous I/O for channel B%d: %s\n",
                        bcs->channel + 1,
                        ret == -EFAULT ? "null URB" : get_usb_rcmsg(ret));
                if (ret != -ENODEV)
                        error_hangup(bcs);
-               spin_unlock_irqrestore(&cs->lock, flags);
                return ret;
        }
 
@@ -1615,11 +1615,11 @@ static int gigaset_init_bchannel(struct bc_state *bcs)
                dev_err(cs->dev, "could not open channel B%d\n",
                        bcs->channel + 1);
                stopurbs(bcs->hw.bas);
-               if (ret != -ENODEV)
-                       error_hangup(bcs);
        }
 
        spin_unlock_irqrestore(&cs->lock, flags);
+       if (ret < 0 && ret != -ENODEV)
+               error_hangup(bcs);
        return ret;
 }