[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251017041128.1379715-1-liqiang01@kylinos.cn>
Date: Fri, 17 Oct 2025 12:11:28 +0800
From: Li Qiang <liqiang01@...inos.cn>
To: miriam.rachel.korenblit@...el.com,
johannes.berg@...el.com,
emmanuel.grumbach@...el.com,
rotem.kerem@...el.com,
yedidya.ben.shimol@...el.com
Cc: linux-wireless@...r.kernel.org,
linux-kernel@...r.kernel.org,
Li Qiang <liqiang01@...inos.cn>
Subject: [PATCH] wifi: iwlwifi: mld: add null check for kzalloc() in iwl_mld_send_proto_offload()
Add a missing NULL pointer check after kzalloc() in
iwl_mld_send_proto_offload(). Without this check, a failed
allocation could lead to a NULL dereference.
Fixes: d1e879ec600f9 ("wifi: iwlwifi: add iwlmld sub-driver")
Signed-off-by: Li Qiang <liqiang01@...inos.cn>
---
drivers/net/wireless/intel/iwlwifi/mld/d3.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/d3.c b/drivers/net/wireless/intel/iwlwifi/mld/d3.c
index 1d4282a21f09..dd85be94433c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/d3.c
@@ -1794,6 +1794,10 @@ iwl_mld_send_proto_offload(struct iwl_mld *mld,
u32 enabled = 0;
cmd = kzalloc(hcmd.len[0], GFP_KERNEL);
+ if (!cmd) {
+ IWL_DEBUG_WOWLAN(mld, "Failed to allocate proto offload cmd\n");
+ return -ENOMEM;
+ }
#if IS_ENABLED(CONFIG_IPV6)
struct iwl_mld_vif *mld_vif = iwl_mld_vif_from_mac80211(vif);
--
2.25.1
Powered by blists - more mailing lists