wifi: iwlwifi: mld: check for NULL pointer after kmalloc

Coverity complained that we didn't add a NULL check for the link we
allocate.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20251019114304.d1f958160c5a.Icc891c14c633c3b8625372680fdc67ca33c83cc7@changeid
This commit is contained in:
Emmanuel Grumbach
2025-10-19 11:45:16 +03:00
committed by Miri Korenblit
parent 5ee10092eb
commit 75dd87e3f1

View File

@@ -465,10 +465,13 @@ int iwl_mld_add_link(struct iwl_mld *mld,
int ret;
if (!link) {
if (is_deflink)
if (is_deflink) {
link = &mld_vif->deflink;
else
} else {
link = kzalloc(sizeof(*link), GFP_KERNEL);
if (!link)
return -ENOMEM;
}
} else {
WARN_ON(!mld->fw_status.in_hw_restart);
}