All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: mt76: add a check of vzalloc in mt7615_coredump_work
@ 2023-02-27 11:57 ` Kang Chen
  0 siblings, 0 replies; 14+ messages in thread
From: Kang Chen @ 2023-02-27 11:57 UTC (permalink / raw)
  To: shayne.chen
  Cc: sean.wang, kvalo, nbd, lorenzo, ryder.lee, davem, edumazet, kuba,
	pabeni, matthias.bgg, angelogioacchino.delregno, linux-wireless,
	netdev, linux-kernel, linux-arm-kernel, linux-mediatek, Kang Chen

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

Signed-off-by: Kang Chen <void0red@gmail.com>
---
 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



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-03-06 11:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-27 11:57 [PATCH] wifi: mt76: add a check of vzalloc in mt7615_coredump_work Kang Chen
2023-02-27 11:57 ` Kang Chen
2023-02-27 13:33 ` Lorenzo Bianconi
2023-02-27 13:33   ` Lorenzo Bianconi
2023-02-27 13:52   ` [PATCH v2] " void0red
2023-02-27 13:52     ` void0red
2023-02-27 14:06     ` Lorenzo Bianconi
2023-02-27 14:06       ` Lorenzo Bianconi
2023-02-27 14:28       ` Kang Chen
2023-02-27 14:28         ` Kang Chen
2023-02-27 14:48       ` [PATCH v3] wifi: mt76: handle failure " void0red
2023-02-27 14:48         ` void0red
2023-03-06 11:00         ` Simon Horman
2023-03-06 11:00           ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.