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
This commit is contained in:
Chaithanya Garrepalli 2018-07-09 17:42:59 +05:30 • committed by nshrivas
commit 157543d36f

View file

@ -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);
}