qcacmn: In serialization timeout timer avoid double free
In serialization timeout timer, do not free memory before removing the cmd from serialization queue. Free only if command is not found in the queue. Change-Id: I775b4230f2cb558142a13cfe0a339f3a20a04a33 CRs-Fixed: 2029599
This commit is contained in:

committed by
Sandeep Puligilla

parent
bc0a546d58
commit
d1f1484105
@@ -156,20 +156,21 @@ static void wlan_serialization_generic_timer_callback(void *arg)
|
||||
}
|
||||
|
||||
serialization_err("active command timeout for cmd_id[%d]", cmd->cmd_id);
|
||||
if (cmd->cmd_cb) {
|
||||
if (cmd->cmd_cb)
|
||||
cmd->cmd_cb(cmd, WLAN_SER_CB_ACTIVE_CMD_TIMEOUT);
|
||||
cmd->cmd_cb(cmd, WLAN_SER_CB_RELEASE_MEM_CMD);
|
||||
}
|
||||
|
||||
serialization_err("active command timeout for cmd_id[%d]", cmd->cmd_id);
|
||||
if (cmd->cmd_type >= WLAN_SER_CMD_NONSCAN)
|
||||
QDF_BUG(0);
|
||||
/*
|
||||
* dequeue cmd API will cleanup and destroy the timer. If it fails to
|
||||
* dequeue command then we have to destroy the timer.
|
||||
* dequeue command then we have to destroy the timer. It will also call
|
||||
* cmd callback with WLAN_SER_CB_RELEASE_MEM_CMD to free the memory.
|
||||
*/
|
||||
if (WLAN_SER_CMD_NOT_FOUND == wlan_serialization_dequeue_cmd(cmd, true))
|
||||
wlan_serialization_timer_destroy(timer);
|
||||
if (cmd->cmd_cb)
|
||||
cmd->cmd_cb(cmd, WLAN_SER_CB_RELEASE_MEM_CMD);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user