aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2008-10-10 17:58:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-14 21:08:11 -0400
commitc25bab54fe30d26a2cddf7058d77da72be630b23 (patch)
tree03a7f6af7176fbeb85d2839903922c132acdf61e /drivers/net/wireless
parent552a71515eef5cba9af8bfe608149557059c4463 (diff)
orinoco: fix unsafe locking in spectrum_cs_suspend
A similar problem was highlighted in the orinoco_cs driver by lockdep. This patch fixes the spectrum_cs driver. Signed-off-by: David Kilroy <kilroyd@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/spectrum_cs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
index 67b26d3c3cd5..f5513cd4db35 100644
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -450,10 +450,11 @@ spectrum_cs_suspend(struct pcmcia_device *link)
450{ 450{
451 struct net_device *dev = link->priv; 451 struct net_device *dev = link->priv;
452 struct orinoco_private *priv = netdev_priv(dev); 452 struct orinoco_private *priv = netdev_priv(dev);
453 unsigned long flags;
453 int err = 0; 454 int err = 0;
454 455
455 /* Mark the device as stopped, to block IO until later */ 456 /* Mark the device as stopped, to block IO until later */
456 spin_lock(&priv->lock); 457 spin_lock_irqsave(&priv->lock, flags);
457 458
458 err = __orinoco_down(dev); 459 err = __orinoco_down(dev);
459 if (err) 460 if (err)
@@ -463,7 +464,7 @@ spectrum_cs_suspend(struct pcmcia_device *link)
463 netif_device_detach(dev); 464 netif_device_detach(dev);
464 priv->hw_unavailable++; 465 priv->hw_unavailable++;
465 466
466 spin_unlock(&priv->lock); 467 spin_unlock_irqrestore(&priv->lock, flags);
467 468
468 return err; 469 return err;
469} 470}