Commit 9e47dd9f authored by Kang Chen's avatar Kang Chen Committed by Felix Fietkau

wifi: mt76: handle failure of vzalloc in mt7615_coredump_work

vzalloc may fails, dump might be null and will cause
illegal address access later.

Link: https://lore.kernel.org/all/Y%2Fy5Asxw3T3m4jCw@lore-desk
Fixes: d2bf7959 ("mt76: mt7663: introduce coredump support")
Signed-off-by: default avatarKang Chen <void0red@gmail.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent e4d2b8bc
......@@ -2380,7 +2380,7 @@ 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) {
if (!dump || data + skb->len - dump > MT76_CONNAC_COREDUMP_SZ) {
dev_kfree_skb(skb);
continue;
}
......@@ -2390,6 +2390,8 @@ void mt7615_coredump_work(struct work_struct *work)
dev_kfree_skb(skb);
}
if (dump)
dev_coredumpv(dev->mt76.dev, dump, MT76_CONNAC_COREDUMP_SZ,
GFP_KERNEL);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment