From: Ben Greear <greearb@candelatech.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC 2/2] mac80211: Fix bss ref leak.
Date: Tue, 18 Jun 2013 09:33:55 -0700 [thread overview]
Message-ID: <51C08BF3.7050706@candelatech.com> (raw)
In-Reply-To: <1371569205.8318.47.camel@jlt4.sipsolutions.net>
On 06/18/2013 08:26 AM, Johannes Berg wrote:
> On Mon, 2013-06-17 at 14:32 -0700, greearb@candelatech.com wrote:
>
>> static void ieee80211_destroy_assoc_data(struct ieee80211_sub_if_data *sdata,
>> - bool assoc)
>> + bool assoc, bool put_bss)
>
> Do we _really_ need another argument? Shouldn't it always be put in the
> non-assoc case anyway, at least if non-NULL?
I don't think so. Check out the ieee80211_rx_mgmt_assoc_resp method.
if (status_code != WLAN_STATUS_SUCCESS) {
sdata_info(sdata, "%pM denied association (code=%d)\n",
mgmt->sa, status_code);
ieee80211_destroy_assoc_data(sdata, false, false);
This passes in false as 'assoc', but we should not free bss here because
it is being passed back to the calling method, and the return
code of RX_MGMT_CFG80211_RX_ASSOC means bss should eventually
be consumed by the cfg80211 logic.
Of course, this is all 'as far as I can tell'.
I sort of like the second boolean because it forces the caller to
think about whether bss should be freed or not...
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2013-06-18 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-17 21:32 [RFC 1/2] wireless: Add memory usage debugging greearb
2013-06-17 21:32 ` [RFC 2/2] mac80211: Fix bss ref leak greearb
2013-06-18 15:26 ` Johannes Berg
2013-06-18 15:38 ` Ben Greear
2013-06-18 16:33 ` Ben Greear [this message]
2013-06-19 14:13 ` 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=51C08BF3.7050706@candelatech.com \
--to=greearb@candelatech.com \
--cc=johannes@sipsolutions.net \
--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).