From: Tilman Schmidt Date: Thu, 30 Sep 2010 13:34:30 +0000 (+0000) Subject: isdn/gigaset: bas_gigaset locking fix X-Git-Tag: firefly_0821_release~9833^2~79^2^2~227 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=82eabdfab00dfc50bad83238059124eebb490cb3;p=firefly-linux-kernel-4.4.55.git isdn/gigaset: bas_gigaset locking fix commit b33ffa5cbf52ee751bb8068218ebb3c742c5a515 upstream. Unlock cs->lock before calling error_hangup() which is marked "cs->lock must not be held". Signed-off-by: Tilman Schmidt Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c index e10f57ed13a4..131976d880d0 100644 --- a/drivers/isdn/gigaset/bas-gigaset.c +++ b/drivers/isdn/gigaset/bas-gigaset.c @@ -1581,13 +1581,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; } @@ -1597,11 +1597,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; }