mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: mt7615: fix possible memory leak in mt7615_mcu_wtbl_sta_add
Free the second mcu skb if __mt76_mcu_skb_send_msg() fails to transmit
the first one in mt7615_mcu_wtbl_sta_add().
Fixes: 99c457d902cf9 ("mt76: mt7615: move mt7615_mcu_set_bmc to mt7615_mcu_ops")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
9a3723c8fe
commit
88fa973f59
+5
-1
@@ -1293,8 +1293,12 @@ mt7615_mcu_wtbl_sta_add(struct mt7615_dev *dev, struct ieee80211_vif *vif,
|
||||
skb = enable ? wskb : sskb;
|
||||
|
||||
err = __mt76_mcu_skb_send_msg(&dev->mt76, skb, cmd, true);
|
||||
if (err < 0)
|
||||
if (err < 0) {
|
||||
skb = enable ? sskb : wskb;
|
||||
dev_kfree_skb(skb);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
cmd = enable ? MCU_EXT_CMD_STA_REC_UPDATE : MCU_EXT_CMD_WTBL_UPDATE;
|
||||
skb = enable ? sskb : wskb;
|
||||
|
||||
Reference in New Issue
Block a user