From: Ben Dooks <ben-linux@fluff.org>
To: netdev@vger.kernel.org
Cc: jeff@garzik.org, Ben Dooks <ben-linux@fluff.org>
Subject: AX88796: Fix locking in ethtool support
Date: Thu, 07 Aug 2008 17:21:09 +0100 [thread overview]
Message-ID: <20080807162109.360877609@fluff.org.uk> (raw)
[-- Attachment #1: simtec/sparse/sparse-ax88796-locking.patch --]
[-- Type: text/plain, Size: 1159 bytes --]
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>
Index: linux-2.6.27-rc2-quilt1/drivers/net/ax88796.c
===================================================================
--- linux-2.6.27-rc2-quilt1.orig/drivers/net/ax88796.c 2008-08-07 17:15:01.000000000 +0100
+++ linux-2.6.27-rc2-quilt1/drivers/net/ax88796.c 2008-08-07 17:17:45.000000000 +0100
@@ -554,7 +554,7 @@ static int ax_get_settings(struct net_de
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_de
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;
}
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
next reply other threads:[~2008-08-07 16:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-07 16:21 Ben Dooks [this message]
2008-08-14 8:44 ` AX88796: Fix locking in ethtool support Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080807162109.360877609@fluff.org.uk \
--to=ben-linux@fluff.org \
--cc=jeff@garzik.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.