Commit c0912585 authored by Ben Dooks's avatar Ben Dooks Committed by Jeff Garzik

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: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 1a3c4bc6
...@@ -554,7 +554,7 @@ static int ax_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -554,7 +554,7 @@ static int ax_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
spin_lock_irqsave(&ax->mii_lock, flags); spin_lock_irqsave(&ax->mii_lock, flags);
mii_ethtool_gset(&ax->mii, cmd); mii_ethtool_gset(&ax->mii, cmd);
spin_lock_irqsave(&ax->mii_lock, flags); spin_unlock_irqrestore(&ax->mii_lock, flags);
return 0; return 0;
} }
...@@ -567,7 +567,7 @@ static int ax_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -567,7 +567,7 @@ static int ax_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
spin_lock_irqsave(&ax->mii_lock, flags); spin_lock_irqsave(&ax->mii_lock, flags);
rc = mii_ethtool_sset(&ax->mii, cmd); rc = mii_ethtool_sset(&ax->mii, cmd);
spin_lock_irqsave(&ax->mii_lock, flags); spin_unlock_irqrestore(&ax->mii_lock, flags);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment