Kalle Valo <kvalo@xxxxxxxxxx> wrote: > @@ -7688,10 +7698,19 @@ int ath12k_mac_vdev_create(struct ath12k *ar, struct ath12k_link_vif *arvif) > u16 nss; > int i; > int ret, vdev_id; > + u8 link_id; > > lockdep_assert_wiphy(hw->wiphy); > > - link_conf = wiphy_dereference(hw->wiphy, vif->link_conf[arvif->link_id]); > + /* If no link is active and scan vdev is requested > + * use a default link conf for scan address purpose. > + */ > + if (arvif->link_id == ATH12K_DEFAULT_SCAN_LINK && vif->valid_links) > + link_id = ffs(vif->valid_links) - 1; link_id = __ffs(vif->valid_links); since it checked vif->valid_links against 0 first. > + else > + link_id = arvif->link_id; > + > + link_conf = wiphy_dereference(hw->wiphy, vif->link_conf[link_id]); > if (!link_conf) { > ath12k_warn(ar->ab, "unable to access bss link conf in vdev create for vif %pM link %u\n", > vif->addr, arvif->link_id);