mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 00:59:55 -04:00
wifi: iwlwifi: mld: check for NULL before referencing a pointer
Errors can happen, and it is better not to risk with a NULL pointer dereference. Make sure that the links-to-remove pointers are not NULL before dereferencing it. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Link: https://patch.msgid.link/20250430151952.408652d45cda.I1bb72836dab17895a2e39910e4493d667db0fa80@changeid
This commit is contained in:
@@ -2450,7 +2450,7 @@ iwl_mld_change_vif_links(struct ieee80211_hw *hw,
|
||||
added |= BIT(0);
|
||||
|
||||
for (int i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
|
||||
if (removed & BIT(i))
|
||||
if (removed & BIT(i) && !WARN_ON(!old[i]))
|
||||
iwl_mld_remove_link(mld, old[i]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user