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>
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);
if (bss->proberesp_ies_allocated)
kfree(bss->pub.proberesp_ies);
- BUG_ON(atomic_read(&bss->hold));
-
kfree(bss);
}