Bladeren bron

qcacmn: Fix mem leak during dp peer delete

AST entry has been allocated at the time of peer creation at DP.
But during peer delete it is not deleted. This leads to memory leak
in the wlan driver. To fix this delete ast entry at the time of
peer deletion.

Change-Id: I8d16b575bd44bf06415c3b1cc44c1c7833c88137
CRs-Fixed: 2273601
Sravan Kumar Kairam 6 jaren geleden
bovenliggende
commit
8e15ed92a1
1 gewijzigde bestanden met toevoegingen van 8 en 0 verwijderingen
  1. 8 0
      dp/wifi3.0/dp_main.c

+ 8 - 0
dp/wifi3.0/dp_main.c

@@ -3579,6 +3579,7 @@ static inline void dp_peer_delete_ast_entries(struct dp_soc *soc,
 	DP_PEER_ITERATE_ASE_LIST(peer, ast_entry, temp_ast_entry)
 		dp_peer_del_ast(soc, ast_entry);
 
+	peer->self_ast_entry = NULL;
 	TAILQ_INIT(&peer->ast_entry_list);
 	qdf_spin_unlock_bh(&soc->ast_lock);
 }
@@ -4239,6 +4240,13 @@ void dp_peer_unref_delete(void *peer_handle)
 		/* remove the reference to the peer from the hash table */
 		dp_peer_find_hash_remove(soc, peer);
 
+		qdf_spin_lock_bh(&soc->ast_lock);
+		if (peer->self_ast_entry) {
+			dp_peer_del_ast(soc, peer->self_ast_entry);
+			peer->self_ast_entry = NULL;
+		}
+		qdf_spin_unlock_bh(&soc->ast_lock);
+
 		TAILQ_FOREACH(tmppeer, &peer->vdev->peer_list, peer_list_elem) {
 			if (tmppeer == peer) {
 				found = 1;