diff --git a/umac/cmn_services/serialization/src/wlan_serialization_internal.c b/umac/cmn_services/serialization/src/wlan_serialization_internal.c index 296a346d5c91..e35749fa7530 100644 --- a/umac/cmn_services/serialization/src/wlan_serialization_internal.c +++ b/umac/cmn_services/serialization/src/wlan_serialization_internal.c @@ -513,15 +513,6 @@ wlan_serialization_dequeue_cmd(struct wlan_serialization_command *cmd, wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock); - /* Call cmd cb for remove request*/ - if (cmd_bkup.cmd_cb) { - /* caller should release the memory */ - ser_debug("Release memory for type %d id %d", - cmd_bkup.cmd_type, cmd_bkup.cmd_id); - cmd_bkup.cmd_cb(&cmd_bkup, - WLAN_SER_CB_RELEASE_MEM_CMD); - } - if (active_cmd) { ser_status = wlan_serialization_move_pending_to_active( cmd_bkup.cmd_type, ser_pdev_obj, @@ -529,6 +520,14 @@ wlan_serialization_dequeue_cmd(struct wlan_serialization_command *cmd, blocking_cmd_removed); } + /* Call cmd cb for remove request*/ + if (cmd_bkup.cmd_cb) { + /* caller should release the memory */ + ser_debug("Release memory for type %d id %d", + cmd_bkup.cmd_type, cmd_bkup.cmd_id); + cmd_bkup.cmd_cb(&cmd_bkup, WLAN_SER_CB_RELEASE_MEM_CMD); + } + if (active_cmd) status = WLAN_SER_CMD_IN_ACTIVE_LIST; else