From 157543d36fa8f0342da587054cfb01b8aca2d6f5 Mon Sep 17 00:00:00 2001 From: Chaithanya Garrepalli Date: Mon, 9 Jul 2018 17:42:59 +0530 Subject: [PATCH] qcacmn: free all the ast entries before freeing ast table While freeing the AST table traverse through table and free any AST entries present in the table Change-Id: I87382da2425380938d91ee1980a9c356c0f647ef CRs-fixed: 2275212 --- dp/wifi3.0/dp_peer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 8b4876708f76..448a0bc39844 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -248,6 +248,24 @@ static inline void dp_peer_ast_cleanup(struct dp_soc *soc, */ static void dp_peer_ast_hash_detach(struct dp_soc *soc) { + unsigned int index; + struct dp_ast_entry *ast, *ast_next; + + if (!soc->ast_hash.mask) + return; + + for (index = 0; index <= soc->ast_hash.mask; index++) { + if (!TAILQ_EMPTY(&soc->ast_hash.bins[index])) { + TAILQ_FOREACH_SAFE(ast, &soc->ast_hash.bins[index], + hash_list_elem, ast_next) { + TAILQ_REMOVE(&soc->ast_hash.bins[index], ast, + hash_list_elem); + dp_peer_ast_cleanup(soc, ast); + qdf_mem_free(ast); + } + } + } + qdf_mem_free(soc->ast_hash.bins); }