mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: mt7915: fix possible memory leak in mt7915_mcu_add_beacon
Release mcu message memory in case of failure in mt7915_mcu_add_beacon
routine
Fixes: e57b7901469fc ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
17ba3432f5
commit
fee1f4a8e8
+10
-8
@@ -2478,14 +2478,6 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw,
|
|||||||
struct bss_info_bcn *bcn;
|
struct bss_info_bcn *bcn;
|
||||||
int len = MT7915_BEACON_UPDATE_SIZE + MAX_BEACON_SIZE;
|
int len = MT7915_BEACON_UPDATE_SIZE + MAX_BEACON_SIZE;
|
||||||
|
|
||||||
rskb = mt7915_mcu_alloc_sta_req(dev, mvif, NULL, len);
|
|
||||||
if (IS_ERR(rskb))
|
|
||||||
return PTR_ERR(rskb);
|
|
||||||
|
|
||||||
tlv = mt7915_mcu_add_tlv(rskb, BSS_INFO_OFFLOAD, sizeof(*bcn));
|
|
||||||
bcn = (struct bss_info_bcn *)tlv;
|
|
||||||
bcn->enable = en;
|
|
||||||
|
|
||||||
skb = ieee80211_beacon_get_template(hw, vif, &offs);
|
skb = ieee80211_beacon_get_template(hw, vif, &offs);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -2496,6 +2488,16 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rskb = mt7915_mcu_alloc_sta_req(dev, mvif, NULL, len);
|
||||||
|
if (IS_ERR(rskb)) {
|
||||||
|
dev_kfree_skb(skb);
|
||||||
|
return PTR_ERR(rskb);
|
||||||
|
}
|
||||||
|
|
||||||
|
tlv = mt7915_mcu_add_tlv(rskb, BSS_INFO_OFFLOAD, sizeof(*bcn));
|
||||||
|
bcn = (struct bss_info_bcn *)tlv;
|
||||||
|
bcn->enable = en;
|
||||||
|
|
||||||
if (mvif->band_idx) {
|
if (mvif->band_idx) {
|
||||||
info = IEEE80211_SKB_CB(skb);
|
info = IEEE80211_SKB_CB(skb);
|
||||||
info->hw_queue |= MT_TX_HW_QUEUE_EXT_PHY;
|
info->hw_queue |= MT_TX_HW_QUEUE_EXT_PHY;
|
||||||
|
|||||||
Reference in New Issue
Block a user