cfg80211: don't BUG_ON BSS struct issues
authorJohannes Berg <johannes.berg@intel.com>
Wed, 28 Nov 2012 21:14:56 +0000 (22:14 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 30 Nov 2012 12:41:24 +0000 (13:41 +0100)
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>
net/wireless/scan.c

index 9596015975d24b011cc22056ed3470bf3c25aabf..5af431f2f90af122086b974a133deefbb13ba38b 100644 (file)
@@ -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);
 
@@ -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);
 }