Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Kilroy and committed by
John W. Linville
c25bab54 552a7151

+3 -2
+3 -2
drivers/net/wireless/spectrum_cs.c
··· 450 450 { 451 451 struct net_device *dev = link->priv; 452 452 struct orinoco_private *priv = netdev_priv(dev); 453 + unsigned long flags; 453 454 int err = 0; 454 455 455 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 459 err = __orinoco_down(dev); 459 460 if (err) ··· 464 463 netif_device_detach(dev); 465 464 priv->hw_unavailable++; 466 465 467 - spin_unlock(&priv->lock); 466 + spin_unlock_irqrestore(&priv->lock, flags); 468 467 469 468 return err; 470 469 }