linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: mt76: add a check of vzalloc in mt7615_coredump_work
@ 2023-02-27 11:57 Kang Chen
  2023-02-27 13:33 ` Lorenzo Bianconi
  0 siblings, 1 reply; 7+ 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

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

Thread overview: 7+ 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 13:33 ` Lorenzo Bianconi
2023-02-27 13:52   ` [PATCH v2] " void0red
2023-02-27 14:06     ` Lorenzo Bianconi
2023-02-27 14:28       ` Kang Chen
2023-02-27 14:48       ` [PATCH v3] wifi: mt76: handle failure " void0red
2023-03-06 11:00         ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).