linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Daniel Drake <dsd@laptop.org>
Cc: linux-wireless@vger.kernel.org
Subject: Re: cfg80211_disconnected memory leak
Date: Thu, 02 Aug 2012 10:02:32 +0200	[thread overview]
Message-ID: <1343894552.4458.4.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <CAMLZHHQdBHZa4NBQ3ygKJSHmKL11ERUWDAtMx0-Qh4OzSoN-SA@mail.gmail.com> (sfid-20120802_012245_707573_C86E060B)

On Wed, 2012-08-01 at 17:22 -0600, Daniel Drake wrote:

> Here is what happens:
> 
> NETDEV_GOING_DOWN
> cfg80211_disconnected() called, disconnect event work queued
> NETDEV_DOWN
> cleanup work queued
> NETDEV_UNREGISTER
> *** cfg80211_netdev_notifier_call now calls: list_del_rcu(&wdev->list);
> disconnect even work runs, calls cfg80211_process_rdev_events() but
> the wdev is already removed from rdev->netdev_list as above
> cleanup work runs
> 
> The bit I marked with *** is what is causing the difficulties - it
> runs before the work items do.

Oh, hm. I didn't think it could unregister before we give up our
reference, but I guess that makes sense after all.

I'm not sure there's an easy way to fix it other than making the driver
not call cfg80211_disconnected() in case the disconnect was requested by
cfg80211 -- that call isn't needed and will not do anything at all, but
I'm not sure how easy that would be in the driver?

johannes


  reply	other threads:[~2012-08-02  8:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 17:36 cfg80211_disconnected memory leak Daniel Drake
2012-08-01 17:39 ` Johannes Berg
2012-08-01 21:04   ` Daniel Drake
2012-08-01 23:22   ` Daniel Drake
2012-08-02  8:02     ` Johannes Berg [this message]
2012-08-02 16:11       ` Daniel Drake
2012-08-02 16:26         ` Johannes Berg
2012-08-02 17:25           ` Daniel Drake
2012-08-02 19:57             ` 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=1343894552.4458.4.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=dsd@laptop.org \
    --cc=linux-wireless@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).