]> git.ipfire.org Git - people/ms/linux.git/blobdiff - net/mac80211/pm.c
Importing "grsecurity-3.1-3.19.2-201503201903.patch"
[people/ms/linux.git] / net / mac80211 / pm.c
index 4a95fe3cffbc9bd9e6d2ff6853b36ebe904b94a4..0bfd71312670cbfa85c8d608d866b0bd50fee109 100644 (file)
@@ -12,7 +12,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
        struct ieee80211_sub_if_data *sdata;
        struct sta_info *sta;
 
-       if (!local->open_count)
+       if (!local_read(&local->open_count))
                goto suspend;
 
        ieee80211_scan_cancel(local);
@@ -59,7 +59,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
        cancel_work_sync(&local->dynamic_ps_enable_work);
        del_timer_sync(&local->dynamic_ps_timer);
 
-       local->wowlan = wowlan && local->open_count;
+       local->wowlan = wowlan && local_read(&local->open_count);
        if (local->wowlan) {
                int err = drv_suspend(local, wowlan);
                if (err < 0) {
@@ -126,7 +126,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
        WARN_ON(!list_empty(&local->chanctx_list));
 
        /* stop hardware - this must stop RX */
-       if (local->open_count)
+       if (local_read(&local->open_count))
                ieee80211_stop_device(local);
 
  suspend: