f814ae718730ecb64b43f5314bd9450e3a0bf32c
[librecmc/librecmc.git] / package / kernel / mac80211 / patches / 307-ath10k-Clean-up-peer-when-sta-goes-away.patch
1 From: Ben Greear <greearb@candelatech.com>
2 Date: Fri, 1 Apr 2016 14:12:11 -0700
3 Subject: [PATCH] ath10k: Clean up peer when sta goes away.
4
5 If WMI and/or firmware has issues removing the peer object,
6 then we still need to clean up the peer object in the driver.
7
8 Signed-off-by: Ben Greear <greearb@candelatech.com>
9 ---
10
11 --- a/drivers/net/wireless/ath/ath10k/mac.c
12 +++ b/drivers/net/wireless/ath/ath10k/mac.c
13 @@ -5949,9 +5949,17 @@ static int ath10k_sta_state(struct ieee8
14                                 continue;
15  
16                         if (peer->sta == sta) {
17 -                               ath10k_warn(ar, "found sta peer %pM entry on vdev %i after it was supposedly removed\n",
18 -                                           sta->addr, arvif->vdev_id);
19 +                               ath10k_warn(ar, "found sta peer %pM (ptr %p id %d) entry on vdev %i after it was supposedly removed\n",
20 +                                           sta->addr, peer, i, arvif->vdev_id);
21                                 peer->sta = NULL;
22 +
23 +                               /* Clean up the peer object as well since we
24 +                                * must have failed to do this above.
25 +                                */
26 +                               list_del(&peer->list);
27 +                               ar->peer_map[i] = NULL;
28 +                               kfree(peer);
29 +                               ar->num_peers--;
30                         }
31                 }
32                 spin_unlock_bh(&ar->data_lock);