All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: netdev@vger.kernel.org
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Michael Buesch <mb@bu3sch.de>, Jean Tourrilhes <jt@hpl.hp.com>,
	Jiri Benc <jbenc@suse.cz>,
	"James P. Ketrenos" <ipw2100-admin@linux.intel.com>,
	Mohamed Abbas <mabbas@linux.intel.com>,
	Ulrich Kunitz <kune@deine-taler.de>,
	Daniel Drake <dsd@gentoo.org>
Subject: Re: [RFC 1/3] cfg80211/nl80211 core
Date: Fri, 06 Oct 2006 11:51:07 +0200	[thread overview]
Message-ID: <1160128267.2715.59.camel@ux156> (raw)
In-Reply-To: <1158230963.2936.49.camel@ux156>

On Thu, 2006-09-14 at 12:49 +0200, Johannes Berg wrote:

> +struct cfg80211_registered_driver *
> +cfg80211_get_drv_from_ifindex(int ifindex)
> +{
> +	struct cfg80211_registered_driver *drv;
> +	struct net_device *dev;
> +
> +	mutex_lock(&cfg80211_drv_mutex);
> +	dev = dev_get_by_index(ifindex);
> +	if (!dev)
> +		return ERR_PTR(-ENODEV);
> +	drv = cfg80211_drv_by_priv(dev->ieee80211_ptr);
> +	if (drv)
> +		mutex_lock(&drv->mtx);
> +	dev_put(dev);
> +	if (drv)
> +		return drv;
> +	return ERR_PTR(-ENODEV);
> +}

So... nobody spotted the "obvious" [1] locking problem here ;) fixed,
will update the patches soon and upload somewhere, netdev doesn't like
them and drops my mail (even 0/3 which wasn't that big).

johannes

[1] hint: drv->mtx is supposed to be left locked at the end, but
cfg80211_drv_mutex isn't :) I found out the hard way when testing my WE
backward compat code


  parent reply	other threads:[~2006-10-06  9:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-14 10:46 more nl80211 stuff Johannes Berg
2006-09-14 10:49 ` [RFC 1/3] cfg80211/nl80211 core Johannes Berg
2006-09-22 15:48   ` Jiri Benc
2006-09-25  9:05     ` Johannes Berg
2006-10-06  9:51   ` Johannes Berg [this message]
2006-09-14 10:50 ` [RFC 2/3] make d80211 use cfg80211 Johannes Berg
2006-09-14 17:53   ` Simon Barber
2006-09-15  6:41     ` Johannes Berg
2006-09-14 10:53 ` [RFC 3/3] cfg80211 thoughts on configuration Johannes Berg
2006-09-20  6:33   ` Thomas Graf
2006-09-20  7:03     ` Johannes Berg
2006-09-20  7:07       ` Thomas Graf
2006-09-14 13:41 ` more nl80211 stuff Dan Williams
2006-09-14 13:55   ` Johannes Berg

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=1160128267.2715.59.camel@ux156 \
    --to=johannes@sipsolutions.net \
    --cc=dsd@gentoo.org \
    --cc=ipw2100-admin@linux.intel.com \
    --cc=jbenc@suse.cz \
    --cc=jt@hpl.hp.com \
    --cc=kune@deine-taler.de \
    --cc=linville@tuxdriver.com \
    --cc=mabbas@linux.intel.com \
    --cc=mb@bu3sch.de \
    --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.