mt76: mt7615: fix potential memory leak in mcu message handler
[ Upstream commit9248c08c3f
] Fix potential memory leak in mcu message handler on error condition. Fixes:0e6a29e477
("mt76: mt7615: add support to read temperature from mcu") Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
54c9afe415
commit
2bf9418b7b
|
@ -119,8 +119,10 @@ mt7615_mcu_parse_response(struct mt7615_dev *dev, int cmd,
|
||||||
struct mt7615_mcu_rxd *rxd = (struct mt7615_mcu_rxd *)skb->data;
|
struct mt7615_mcu_rxd *rxd = (struct mt7615_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:
|
||||||
|
@ -134,6 +136,7 @@ mt7615_mcu_parse_response(struct mt7615_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