qcacmn: Avoid timer double free when disable scheduler

A global timer is created and freed by each module, if passed as
msg to mc queues, shouldn't be freed in scheduler_cleanup_queues,
or double free issue happens

For example, a timer in tLimTimers is freed in mac_stop->pe_stop
->lim_cleanup_mlm

Change-Id: I919b13f2570e3496a1de249fd90a88f3bfeaa131
CRs-Fixed: 2220514
This commit is contained in:
Zhu Jianmin 2018-05-09 20:28:25 +08:00 • committed by nshrivas
commit 1c6bb03362

View file

@ -433,9 +433,16 @@ void scheduler_cleanup_queues(struct scheduler_ctx *sch_ctx, int idx)
while ((msg_wrapper =
scheduler_mq_get(&sch_ctx->queue_ctx.sch_msg_q[idx]))) {
if (msg_wrapper->msg_buf) {
sched_info("Freeing MC WMA MSG message type %d",
msg_wrapper->msg_buf->type);
if ((QDF_MODULE_ID_SYS ==
sch_ctx->queue_ctx.sch_msg_q[idx].qid) &&
(SYS_MSG_ID_MC_TIMER ==
msg_wrapper->msg_buf->type)) {
sched_debug("Timer is freed by each module, not here");
continue;
}
sched_info("Freeing MC MSG message type %d, module id:%d",
msg_wrapper->msg_buf->type,
sch_ctx->queue_ctx.sch_msg_q[idx].qid);
if (msg_wrapper->msg_buf->flush_callback) {
sched_debug("Flush callback called for type-%x",
msg_wrapper->msg_buf->type);