From: greearb@candelatech.com
To: linux-wireless@vger.kernel.org
Cc: Ben Greear <greearb@candelatech.com>
Subject: [PATCH-WN 2/3] wireless: Check for dangling wdev->current_bss pointer.
Date: Wed, 19 Jun 2013 14:06:26 -0700 [thread overview]
Message-ID: <1371675987-28732-2-git-send-email-greearb@candelatech.com> (raw)
In-Reply-To: <1371675987-28732-1-git-send-email-greearb@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
If it *is* still set when the netdev is being deleted,
then we are about to leak a pointer. Warn and clean up
in that case.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
This is against wireless-next. I've never seen this hit,
though possibly it would catch some future bugs. If you
think it's not useful, I won't argue :)
net/wireless/core.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 9143288..042d6a3 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -934,6 +934,12 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
* freed.
*/
cfg80211_process_wdev_events(wdev);
+
+ if (WARN_ON(wdev->current_bss)) {
+ cfg80211_unhold_bss(wdev->current_bss);
+ cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
+ wdev->current_bss = NULL;
+ }
break;
case NETDEV_PRE_UP:
if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
--
1.7.3.4
next prev parent reply other threads:[~2013-06-19 21:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 21:06 [PATCH-WN 1/3] wireless: Make sure __cfg80211_connect_result always puts bss greearb
2013-06-19 21:06 ` greearb [this message]
2013-06-19 21:06 ` [PATCH-WN 3/3] wireless: Add comments about bss refcounting greearb
2013-06-24 13:56 ` [PATCH-WN 1/3] wireless: Make sure __cfg80211_connect_result always puts bss Johannes Berg
2013-06-24 14:46 ` Ben Greear
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=1371675987-28732-2-git-send-email-greearb@candelatech.com \
--to=greearb@candelatech.com \
--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 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.