Skip to content

Commit d0c3c75

Browse files
committed
Merge tag 'mac80211-for-davem-2020-07-30' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Johannes Berg says: ==================== A couple of more changes: * remove a warning that can trigger in certain races * check a function pointer before using it * check before adding 6 GHz to avoid a warning in mesh * fix two memory leaks in mesh * fix a TX status bug leading to a memory leak ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 85496a2 + 04e35ca commit d0c3c75

File tree

7 files changed

+27
-9
lines changed

7 files changed

+27
-9
lines changed

net/mac80211/cfg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,6 +2166,7 @@ static int ieee80211_leave_mesh(struct wiphy *wiphy, struct net_device *dev)
21662166
ieee80211_stop_mesh(sdata);
21672167
mutex_lock(&sdata->local->mtx);
21682168
ieee80211_vif_release_channel(sdata);
2169+
kfree(sdata->u.mesh.ie);
21692170
mutex_unlock(&sdata->local->mtx);
21702171

21712172
return 0;

net/mac80211/mesh.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,19 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
617617
int mesh_add_he_6ghz_cap_ie(struct ieee80211_sub_if_data *sdata,
618618
struct sk_buff *skb)
619619
{
620+
struct ieee80211_supported_band *sband;
621+
const struct ieee80211_sband_iftype_data *iftd;
622+
623+
sband = ieee80211_get_sband(sdata);
624+
if (!sband)
625+
return -EINVAL;
626+
627+
iftd = ieee80211_get_sband_iftype_data(sband,
628+
NL80211_IFTYPE_MESH_POINT);
629+
/* The device doesn't support HE in mesh mode or at all */
630+
if (!iftd)
631+
return 0;
632+
620633
ieee80211_ie_build_he_6ghz_cap(sdata, skb);
621634
return 0;
622635
}

net/mac80211/mesh_pathtbl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl,
521521
del_timer_sync(&mpath->timer);
522522
atomic_dec(&sdata->u.mesh.mpaths);
523523
atomic_dec(&tbl->entries);
524+
mesh_path_flush_pending(mpath);
524525
kfree_rcu(mpath, rcu);
525526
}
526527

net/mac80211/sta_info.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,9 +1923,7 @@ void ieee80211_sta_update_pending_airtime(struct ieee80211_local *local,
19231923
if (sta) {
19241924
tx_pending = atomic_sub_return(tx_airtime,
19251925
&sta->airtime[ac].aql_tx_pending);
1926-
if (WARN_ONCE(tx_pending < 0,
1927-
"STA %pM AC %d txq pending airtime underflow: %u, %u",
1928-
sta->addr, ac, tx_pending, tx_airtime))
1926+
if (tx_pending < 0)
19291927
atomic_cmpxchg(&sta->airtime[ac].aql_tx_pending,
19301928
tx_pending, 0);
19311929
}

net/mac80211/tx.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4230,11 +4230,12 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
42304230
test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state))
42314231
goto out_free;
42324232

4233+
memset(info, 0, sizeof(*info));
4234+
42334235
if (unlikely(!multicast && skb->sk &&
42344236
skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS))
4235-
ieee80211_store_ack_skb(local, skb, &info->flags, NULL);
4236-
4237-
memset(info, 0, sizeof(*info));
4237+
info->ack_frame_id = ieee80211_store_ack_skb(local, skb,
4238+
&info->flags, NULL);
42384239

42394240
if (unlikely(sdata->control_port_protocol == ehdr->h_proto)) {
42404241
if (sdata->control_port_no_encrypt)

net/mac80211/util.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,6 +2878,10 @@ void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
28782878
if (WARN_ON(!iftd))
28792879
return;
28802880

2881+
/* Check for device HE 6 GHz capability before adding element */
2882+
if (!iftd->he_6ghz_capa.capa)
2883+
return;
2884+
28812885
cap = le16_to_cpu(iftd->he_6ghz_capa.capa);
28822886
cap &= ~IEEE80211_HE_6GHZ_CAP_SM_PS;
28832887

net/wireless/nl80211.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13266,13 +13266,13 @@ static int nl80211_vendor_cmd(struct sk_buff *skb, struct genl_info *info)
1326613266
if (!wdev_running(wdev))
1326713267
return -ENETDOWN;
1326813268
}
13269-
13270-
if (!vcmd->doit)
13271-
return -EOPNOTSUPP;
1327213269
} else {
1327313270
wdev = NULL;
1327413271
}
1327513272

13273+
if (!vcmd->doit)
13274+
return -EOPNOTSUPP;
13275+
1327613276
if (info->attrs[NL80211_ATTR_VENDOR_DATA]) {
1327713277
data = nla_data(info->attrs[NL80211_ATTR_VENDOR_DATA]);
1327813278
len = nla_len(info->attrs[NL80211_ATTR_VENDOR_DATA]);

0 commit comments

Comments
 (0)