mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 00:48:50 +00:00
mt76: mt7915: fix possible memory leak in mt7915_mcu_add_sta
[ Upstream commita43736cd12
] Free allocated skb in mt7915_mcu_add_sta routine in case of failures. Fixes:89bbd3730f
("mt76: mt7915: rework starec TLV tags") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
5c2ef67f48
commit
b334a245ff
1 changed files with 6 additions and 2 deletions
|
@ -2399,8 +2399,10 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
|||
}
|
||||
|
||||
ret = mt7915_mcu_sta_wtbl_tlv(dev, skb, vif, sta);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_kfree_skb(skb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (sta && sta->ht_cap.ht_supported) {
|
||||
/* starec amsdu */
|
||||
|
@ -2414,8 +2416,10 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
|||
}
|
||||
|
||||
ret = mt7915_mcu_add_group(dev, vif, sta);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_kfree_skb(skb);
|
||||
return ret;
|
||||
}
|
||||
out:
|
||||
return mt76_mcu_skb_send_msg(&dev->mt76, skb,
|
||||
MCU_EXT_CMD(STA_REC_UPDATE), true);
|
||||
|
|
Loading…
Reference in a new issue