Skip to content

Commit

Permalink
mt76: mt7615: fix memory leak in mt7615_coredump_work
Browse files Browse the repository at this point in the history
Similar to the issue fixed in mt7921_coredump_work, fix a possible memory
leak in mt7615_coredump_work routine.

Fixes: d2bf7959d9c0f ("mt76: mt7663: introduce coredump support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Mar 14, 2021
1 parent 8e3f5bf commit 8e3bba8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mt7615/mac.c
Expand Up @@ -2352,8 +2352,10 @@ void mt7615_coredump_work(struct work_struct *work)
break;

skb_pull(skb, sizeof(struct mt7615_mcu_rxd));
if (data + skb->len - dump > MT76_CONNAC_COREDUMP_SZ)
break;
if (data + skb->len - dump > MT76_CONNAC_COREDUMP_SZ) {
dev_kfree_skb(skb);
continue;
}

memcpy(data, skb->data, skb->len);
data += skb->len;
Expand Down

0 comments on commit 8e3bba8

Please sign in to comment.