mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
mt76: mt7915: fix potential memory leak in mcu message handler
Fix potential memory leak in mcu message handler on error condition. Fixes: c6b002bcdfa6 ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
1f8284150d
commit
4c7e1711cf
@ -312,8 +312,10 @@ mt7915_mcu_parse_response(struct mt7915_dev *dev, int cmd,
|
|||||||
struct mt7915_mcu_rxd *rxd = (struct mt7915_mcu_rxd *)skb->data;
|
struct mt7915_mcu_rxd *rxd = (struct mt7915_mcu_rxd *)skb->data;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (seq != rxd->seq)
|
if (seq != rxd->seq) {
|
||||||
return -EAGAIN;
|
ret = -EAGAIN;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case -MCU_CMD_PATCH_SEM_CONTROL:
|
case -MCU_CMD_PATCH_SEM_CONTROL:
|
||||||
@ -330,6 +332,7 @@ mt7915_mcu_parse_response(struct mt7915_dev *dev, int cmd,
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user