qcacmn: Trigger panic on SKB memory leak in debug builds

To catch SKB memory leaks trigger panic on SKB leak in SLUB debug builds
if CONFIG_HALT_KMEMLEAK is enabled.

Change-Id: I25b65454ec3954fdcbf6e39390ac793ee77fc1f4
CRs-Fixed: 2049330
This commit is contained in:
Rajeev Kumar 2017-05-18 15:45:16 -07:00 • committed by snandini
commit f37f18e2b3
2 changed files with 8 additions and 1 deletions

View file

@ -844,7 +844,7 @@ void qdf_mem_clean(void)
prev_mleak_line_num, prev_mleak_sz);
}
#ifdef CONFIG_HALT_KMEMLEAK
BUG_ON(1);
QDF_BUG(0);
#endif
}
}

View file

@ -1442,6 +1442,7 @@ EXPORT_SYMBOL(qdf_net_buf_debug_init);
void qdf_net_buf_debug_exit(void)
{
uint32_t i;
uint32_t count = 0;
unsigned long irq_flag;
QDF_NBUF_TRACK *p_node;
QDF_NBUF_TRACK *p_prev;
@ -1452,6 +1453,7 @@ void qdf_net_buf_debug_exit(void)
while (p_node) {
p_prev = p_node;
p_node = p_node->p_next;
count++;
qdf_print("SKB buf memory Leak@ File %s, @Line %d, size %zu\n",
p_prev->file_name, p_prev->line_num,
p_prev->size);
@ -1462,6 +1464,11 @@ void qdf_net_buf_debug_exit(void)
qdf_nbuf_track_memory_manager_destroy();
#ifdef CONFIG_HALT_KMEMLEAK
if (count)
QDF_BUG(0);
#endif
return;
}
EXPORT_SYMBOL(qdf_net_buf_debug_exit);