mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 10:01:00 +00:00
mt76: mt7615: fix potential memory leak in mcu message handler
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>
This commit is contained in:
parent
c876039e95
commit
9248c08c3f
1 changed files with 5 additions and 2 deletions
|
@ -183,8 +183,10 @@ mt7615_mcu_parse_response(struct mt7615_dev *dev, int cmd,
|
|||
struct mt7615_mcu_rxd *rxd = (struct mt7615_mcu_rxd *)skb->data;
|
||||
int ret = 0;
|
||||
|
||||
if (seq != rxd->seq)
|
||||
return -EAGAIN;
|
||||
if (seq != rxd->seq) {
|
||||
ret = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
||||
switch (cmd) {
|
||||
case MCU_CMD_PATCH_SEM_CONTROL:
|
||||
|
@ -215,6 +217,7 @@ mt7615_mcu_parse_response(struct mt7615_dev *dev, int cmd,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
out:
|
||||
dev_kfree_skb(skb);
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue