netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Ben Dooks <ben-linux@fluff.org>
Cc: netdev@vger.kernel.org
Subject: Re: AX88796: Fix locking in ethtool support
Date: Thu, 14 Aug 2008 04:44:38 -0400	[thread overview]
Message-ID: <48A3F076.8080206@garzik.org> (raw)
In-Reply-To: <20080807162109.360877609@fluff.org.uk>

Ben Dooks wrote:
> 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);

applied



      reply	other threads:[~2008-08-14  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-07 16:21 AX88796: Fix locking in ethtool support Ben Dooks
2008-08-14  8:44 ` Jeff Garzik [this message]

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=48A3F076.8080206@garzik.org \
    --to=jeff@garzik.org \
    --cc=ben-linux@fluff.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).