mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
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: d2bf7959d9c0 ("mt76: mt7663: introduce coredump support") Signed-off-by: Kang Chen <[email protected]>
This commit is contained in:
+5
-3
@@ -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);
|
||||
}
|
||||
dev_coredumpv(dev->mt76.dev, dump, MT76_CONNAC_COREDUMP_SZ,
|
||||
GFP_KERNEL);
|
||||
|
||||
if (dump)
|
||||
dev_coredumpv(dev->mt76.dev, dump, MT76_CONNAC_COREDUMP_SZ,
|
||||
GFP_KERNEL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user