Thread (7 messages) 7 messages, 3 authors, 2023-03-06
STALE1181d

[PATCH] wifi: mt76: add a check of vzalloc in mt7615_coredump_work

From: Kang Chen <hidden>
Date: 2023-02-27 11:57:31
Also in: linux-arm-kernel, linux-mediatek, lkml, netdev
Subsystem: mediatek mt76 wireless lan driver, the rest · Maintainers: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Linus Torvalds

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

Signed-off-by: Kang Chen <redacted>
---
 drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index a95602473..73d84c301 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -2367,6 +2367,9 @@ void mt7615_coredump_work(struct work_struct *work)
 	}
 
 	dump = vzalloc(MT76_CONNAC_COREDUMP_SZ);
+	if (!dump)
+		return;
+
 	data = dump;
 
 	while (true) {
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help