Browse Source

qcacld-3.0: In get_channel check link VDEV's assoc state

Kernel calls get_channel callback registered in cfg80211_ops to
fetch the channel information.
For a two or more links MLO connection, the state of assoc VDEV
will be set to associated before get_channel API is called, but
for partner link VDEV might still be in unassociated state and
get_channel request on parter link will lead to sending invalid
channel information to kernel and result in kernel warning.

If partner VDEV is not in associated state, return error to avoid
kernel warning.

Change-Id: I7ac3f6e08301419a9dc916e59f611537ccf88d45
CRs-Fixed: 3392518
Vinod Kumar Pirla 2 years ago
parent
commit
eadaf118f2
1 changed files with 9 additions and 0 deletions
  1. 9 0
      core/hdd/src/wlan_hdd_cfg80211.c

+ 9 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -25513,6 +25513,8 @@ static int __wlan_hdd_cfg80211_get_channel(struct wiphy *wiphy,
 	bool is_legacy_phymode = false;
 	struct wlan_objmgr_vdev *vdev;
 	uint32_t chan_freq;
+	struct hdd_adapter *link_adapter;
+	uint8_t vdev_id;
 
 	hdd_enter_dev(wdev->netdev);
 
@@ -25564,6 +25566,13 @@ static int __wlan_hdd_cfg80211_get_channel(struct wiphy *wiphy,
 	if (!vdev)
 		return -EINVAL;
 
+	vdev_id = wlan_vdev_get_id(vdev);
+	link_adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
+	if (link_adapter && !hdd_cm_is_vdev_associated(link_adapter)) {
+		wlan_key_put_link_vdev(vdev, WLAN_OSIF_ID);
+		return -EBUSY;
+	}
+
 	chan_freq = vdev->vdev_mlme.des_chan->ch_freq;
 	chandef->center_freq1 = vdev->vdev_mlme.des_chan->ch_cfreq1;
 	chandef->center_freq2 = 0;