Skip to content

Commit

Permalink
AX88796: Fix locking in ethtool support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Dooks authored and Jeff Garzik committed Aug 14, 2008
1 parent 1a3c4bc commit c091258
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ax88796.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit c091258

Please sign in to comment.