Browse Source

qcacld-3.0: Remove sta_id check in NDP peer handlers

sta_id is carrying an uninitialized value from the caller
lim_send_sme_ndp_(add/del)_sta_rsp(). So, it's failing the
check for its validity and skipping the first NDP peer creation
/last NDP peer cleanup.
Remove the sta_id check as it's no longer used. So that the NDP
peer creation/cleanup happens properly.

Change-Id: I8daff2bfbc57b7a2fa17a121a5a9dec6975137de
CRs-Fixed: 2594317
Srinivas Dasari 5 years ago
parent
commit
b020999b07
2 changed files with 5 additions and 17 deletions
  1. 1 11
      core/hdd/src/wlan_hdd_nan_datapath.c
  2. 4 6
      os_if/nan/src/os_if_nan.c

+ 1 - 11
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -848,11 +848,6 @@ int hdd_ndp_new_peer_handler(uint8_t vdev_id, uint16_t sta_id,
 		return -EINVAL;
 	}
 
-	if (sta_id >= HDD_MAX_ADAPTERS) {
-		hdd_err("Error: Invalid sta_id: %u", sta_id);
-		return -EINVAL;
-	}
-
 	/* save peer in ndp ctx */
 	if (!hdd_save_peer(sta_ctx, peer_mac_addr)) {
 		hdd_err("Ndp peer table full. cannot save new peer");
@@ -918,11 +913,6 @@ void hdd_ndp_peer_departed_handler(uint8_t vdev_id, uint16_t sta_id,
 		return;
 	}
 
-	if (sta_id >= HDD_MAX_ADAPTERS) {
-		hdd_err("Error: Invalid sta_id: %u", sta_id);
-		return;
-	}
-
 	hdd_roam_deregister_sta(adapter, *peer_mac_addr);
 	hdd_delete_peer(sta_ctx, peer_mac_addr);
 

+ 4 - 6
os_if/nan/src/os_if_nan.c

@@ -1855,9 +1855,8 @@ static void os_if_new_peer_ind_handler(struct wlan_objmgr_vdev *vdev,
 		return;
 	}
 
-	osif_debug("vdev_id: %d, peer_mac: %pM, sta_id: %d",
-		   vdev_id, peer_ind->peer_mac_addr.bytes,
-		   peer_ind->sta_id);
+	osif_debug("vdev_id: %d, peer_mac: %pM",
+		   vdev_id, peer_ind->peer_mac_addr.bytes);
 	ret = cb_obj.new_peer_ind(vdev_id, peer_ind->sta_id,
 				&peer_ind->peer_mac_addr,
 				(active_peers == 0 ? true : false));
@@ -1897,9 +1896,8 @@ static void os_if_peer_departed_ind_handler(struct wlan_objmgr_vdev *vdev,
 		osif_err("Invalid new NDP peer params");
 		return;
 	}
-	osif_debug("vdev_id: %d, peer_mac: %pM, sta_id: %d",
-		   vdev_id, peer_ind->peer_mac_addr.bytes,
-		   peer_ind->sta_id);
+	osif_debug("vdev_id: %d, peer_mac: %pM",
+		   vdev_id, peer_ind->peer_mac_addr.bytes);
 	active_peers--;
 	ucfg_nan_set_active_peers(vdev, active_peers);
 	cb_obj.peer_departed_ind(vdev_id, peer_ind->sta_id,