Skip to content

Commit

Permalink
cfg80211: don't BUG_ON BSS struct issues
Browse files Browse the repository at this point in the history
There's no need to stop the machine, just leak
the BSS entry if there's an issue with its hold
counter when freeing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Nov 30, 2012
1 parent 41e31b8 commit b629ea3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ static void bss_release(struct kref *ref)
struct cfg80211_internal_bss *bss;

bss = container_of(ref, struct cfg80211_internal_bss, ref);

if (WARN_ON(atomic_read(&bss->hold)))
return;

if (bss->pub.free_priv)
bss->pub.free_priv(&bss->pub);

Expand All @@ -34,8 +38,6 @@ static void bss_release(struct kref *ref)
if (bss->proberesp_ies_allocated)
kfree(bss->pub.proberesp_ies);

BUG_ON(atomic_read(&bss->hold));

kfree(bss);
}

Expand Down

0 comments on commit b629ea3

Please sign in to comment.