diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-08-07 17:21:09 +0100 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-08-14 04:44:21 -0400 |
commit | c0912585ec8b64d846d56995241f2c8a7f48ee75 (patch) | |
tree | a1d55fd65b6f018b0537d353c35c71633f46da13 /drivers/net/ax88796.c | |
parent | 1a3c4bc61547e5a75fd3b85b425624756da4cffb (diff) | |
download | op-kernel-dev-c0912585ec8b64d846d56995241f2c8a7f48ee75.zip op-kernel-dev-c0912585ec8b64d846d56995241f2c8a7f48ee75.tar.gz |
AX88796: Fix locking in ethtool support
Fix a pair of nasty locking problems in the ax88796 driver
spotted by a sparse check:
warning: context imbalance in 'ax_get_settings' - wrong count at exit
warning: context imbalance in 'ax_set_settings' - wrong count at exit
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/ax88796.c')
-rw-r--r-- | drivers/net/ax88796.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c index 0b4adf4..a886a4b 100644 --- a/drivers/net/ax88796.c +++ b/drivers/net/ax88796.c @@ -554,7 +554,7 @@ static int ax_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) spin_lock_irqsave(&ax->mii_lock, flags); mii_ethtool_gset(&ax->mii, cmd); - spin_lock_irqsave(&ax->mii_lock, flags); + spin_unlock_irqrestore(&ax->mii_lock, flags); return 0; } @@ -567,7 +567,7 @@ static int ax_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) spin_lock_irqsave(&ax->mii_lock, flags); rc = mii_ethtool_sset(&ax->mii, cmd); - spin_lock_irqsave(&ax->mii_lock, flags); + spin_unlock_irqrestore(&ax->mii_lock, flags); return rc; } |