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 18:26:29 +0200	[thread overview]
Message-ID: <1343924789.4471.26.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <CAMLZHHSVediwHaw3f8s1QYNoc_xV55CEUP7wBQu_on-p8WUQJg@mail.gmail.com> (sfid-20120802_181111_388647_3D9BB914)

On Thu, 2012-08-02 at 10:11 -0600, Daniel Drake wrote:
> On Thu, Aug 2, 2012 at 2:02 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > 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?
> 
> I guess you've considered clearing all the pending work before
> removing a netdev from the rdev's list?

Yes, but we can't just try to flush the workqueue because of locking
concerns in this area.

Hmm. Then again, I think we can call cfg80211_process_wdev_events() from
case NETDEV_UNREGISTER though, probably after removing from the list.
Maybe you could try that?

> I think a driver modification would be easy, if it is the right solution.
> 
> lbs_disconnect() is the function that calls cfg80211_disconnected().
> We only ever call this in 2 contexts:
> 
> 1. From our cfg80211_ops.disconnect handler - you say this isn't needed
> 2. From the netdev ndo_stop handler - I guess it is also not necessary
> to inform cfg80211 that we have disconnected at this point, it is kind
> of obvious..?

In fact, you won't get to ndo_stop without cfg80211 calling
disconnect(), because it does that from NETDEV_GOING_DOWN.

> So completely removing the call to cfg80211_disconnected() may be the
> right option here, is that what you recommend?

I'm not 100% sure about the API in this area right now though, it's been
a while and I never worked much with this API (rather than the mac80211
one with auth/assoc/disassoc/deauth.)

johannes


  reply	other threads:[~2012-08-02 16:26 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
2012-08-02 16:11       ` Daniel Drake
2012-08-02 16:26         ` Johannes Berg [this message]
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=1343924789.4471.26.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).