Browse Source

qcacmn: Flush rx cache frames at peer delete

Currently cached rx buffer frames are forwarded to stack
at the time of successful association completion. If the
association with the AP is unsuccessful frames are not
flushed and this leads to memory leak. To fix this clear
the cached buffers at the time of peer deletion.

Change-Id: Icec36376f9588dba8114f855ac9719b5735512e8
CRs-Fixed: 2452030
Sravan Kumar Kairam 5 years ago
parent
commit
5b8283fe08
1 changed files with 3 additions and 1 deletions
  1. 3 1
      dp/wifi3.0/dp_main.c

+ 3 - 1
dp/wifi3.0/dp_main.c

@@ -5698,6 +5698,7 @@ void dp_peer_unref_delete(void *peer_handle)
 #ifdef PEER_CACHE_RX_PKTS
 static inline void dp_peer_rx_bufq_resources_deinit(struct dp_peer *peer)
 {
+	dp_rx_flush_rx_cached(peer, true);
 	qdf_list_destroy(&peer->bufq_info.cached_bufq);
 	qdf_spinlock_destroy(&peer->bufq_info.bufq_lock);
 }
@@ -5738,10 +5739,11 @@ static void dp_peer_delete_wifi3(void *peer_handle, uint32_t bitmap)
 		FL("peer %pK (%pM)"),  peer, peer->mac_addr.raw);
 
 	dp_local_peer_id_free(peer->vdev->pdev, peer);
-	qdf_spinlock_destroy(&peer->peer_info_lock);
 
 	dp_peer_rx_bufq_resources_deinit(peer);
 
+	qdf_spinlock_destroy(&peer->peer_info_lock);
+
 	/*
 	 * Remove the reference added during peer_attach.
 	 * The peer will still be left allocated until the