[PATCH] [29/223] isdn/gigaset: bas_gigaset locking fix

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andi Kleen
Date: Sunday, December 12, 2010 - 4:45 pm

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Tilman Schmidt <tilman@imap.cc>

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 |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux/drivers/isdn/gigaset/bas-gigaset.c
===================================================================
--- linux.orig/drivers/isdn/gigaset/bas-gigaset.c
+++ linux/drivers/isdn/gigaset/bas-gigaset.c
@@ -1599,13 +1599,13 @@ static int gigaset_init_bchannel(struct
 
 	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
 		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;
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [0/223] 2.6.35.10 longterm review, Andi Kleen, (Sun Dec 12, 4:44 pm)
[PATCH] [10/223] cfg80211: fix BSS double-unlinking, Andi Kleen, (Sun Dec 12, 4:45 pm)
[PATCH] [11/223] cfg80211: fix locking, Andi Kleen, (Sun Dec 12, 4:45 pm)
[PATCH] [29/223] isdn/gigaset: bas_gigaset locking fix, Andi Kleen, (Sun Dec 12, 4:45 pm)
[PATCH] [42/223] NFSv4: Fix open recovery, Andi Kleen, (Sun Dec 12, 4:45 pm)
Re: [PATCH] [0/223] 2.6.35.10 longterm review, Randy Dunlap, (Thu Dec 16, 10:42 am)