Explorar el Código

qcacld-3.0: Add checks in mlo api's

- Pass appropriate length size in lim_send_mlo_caps_ie().
- Initialize ml ie reserved bits to 0.
- Add null check in mlo_cm_roam_sync_cb() and
lim_mlo_roam_delete_link_peer().

Change-Id: I70abcca14f29b4a417ae8ca3dda840bbef0de6a0
CRs-Fixed: 3126553
Amruta Kulkarni hace 3 años
padre
commit
6b446b0074

+ 6 - 1
components/umac/mlme/mlo_mgr/src/wlan_mlo_mgr_roam.c

@@ -213,7 +213,7 @@ void mlo_cm_roam_sync_cb(struct wlan_objmgr_vdev *vdev,
 	QDF_STATUS status;
 	struct roam_offload_synch_ind *sync_ind;
 	struct wlan_objmgr_psoc *psoc;
-	struct wlan_objmgr_vdev *link_vdev;
+	struct wlan_objmgr_vdev *link_vdev = NULL;
 	uint8_t i;
 	uint8_t vdev_id;
 
@@ -232,6 +232,11 @@ void mlo_cm_roam_sync_cb(struct wlan_objmgr_vdev *vdev,
 								 sync_ind->ml_link[i].vdev_id,
 								 WLAN_MLME_SB_ID);
 
+		if (!link_vdev) {
+			mlo_err("Link vdev is null");
+			return;
+		}
+
 		if (mlo_check_connect_req_bmap(link_vdev)) {
 			mlo_update_connect_req_links(link_vdev, false);
 

+ 5 - 1
core/mac/src/pe/lim/lim_api.c

@@ -3395,7 +3395,7 @@ void
 lim_mlo_roam_delete_link_peer(struct pe_session *pe_session,
 			      tpDphHashNode sta_ds)
 {
-	struct wlan_objmgr_peer *peer;
+	struct wlan_objmgr_peer *peer = NULL;
 	struct mac_context *mac;
 
 	mac = cds_get_context(QDF_MODULE_ID_PE);
@@ -3415,6 +3415,10 @@ lim_mlo_roam_delete_link_peer(struct pe_session *pe_session,
 	peer = wlan_objmgr_get_peer_by_mac(mac->psoc,
 					   sta_ds->staAddr,
 					   WLAN_LEGACY_MAC_ID);
+	if (!peer) {
+		mlo_err("Peer is null");
+		return;
+	}
 
 	wlan_mlo_link_peer_delete(peer);
 

+ 2 - 2
core/mac/src/pe/lim/lim_utils.c

@@ -8149,11 +8149,11 @@ QDF_STATUS lim_send_mlo_caps_ie(struct mac_context *mac_ctx,
 
 	status_2g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_MLO_IE,
 				CDS_BAND_2GHZ, &mlo_caps[2],
-				mlo_cap_total_len);
+				EHT_CAP_OUI_LEN + QDF_MAC_ADDR_SIZE);
 
 	status_5g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_MLO_IE,
 				CDS_BAND_5GHZ, &mlo_caps[2],
-				mlo_cap_total_len);
+				EHT_CAP_OUI_LEN + QDF_MAC_ADDR_SIZE);
 
 	if (QDF_IS_STATUS_SUCCESS(status_2g) &&
 	    QDF_IS_STATUS_SUCCESS(status_5g)) {

+ 2 - 0
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -7663,6 +7663,8 @@ populate_dot11f_mlo_caps(struct mac_context *mac_ctx,
 	mlo_ie->medium_sync_delay_info_present = 0;
 	mlo_ie->eml_capab_present = 0;
 	mlo_ie->mld_capab_present = 1;
+	mlo_ie->reserved = 0;
+	mlo_ie->reserved_1 = 0;
 
 	return QDF_STATUS_SUCCESS;
 }