Commit 2a705bc3 authored by Johannes Berg's avatar Johannes Berg

wifi: mac80211: check link exists before use

If the assoc link doesn't exist yet at this point, we
cannot use it yet. This isn't normally the case, but
e.g. in case of FT-DS (or just broken userspace) the
link might not be set up yet and will only be created
later in this function. Check that the link exists.

Fixes: 310c8387 ("wifi: mac80211: clean up connection process")
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/3151f5d0-c18f-413d-b34b-b94f095b947c@moroto.mountainReviewed-by: default avatarMiriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240301193633.c886d300e90a.Ie1d5e23b2a033d934d343c37249f6f4dfddcc5fe@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 01ad6b7b
...@@ -8173,7 +8173,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -8173,7 +8173,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
eth_random_addr(assoc_data->link[i].addr); eth_random_addr(assoc_data->link[i].addr);
sband = local->hw.wiphy->bands[link_cbss->channel->band]; sband = local->hw.wiphy->bands[link_cbss->channel->band];
if (match_auth && i == assoc_link_id) if (match_auth && i == assoc_link_id && link)
assoc_data->link[i].conn = link->u.mgd.conn; assoc_data->link[i].conn = link->u.mgd.conn;
else else
assoc_data->link[i].conn = assoc_data->link[i].conn =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment