diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2010-02-19 16:00:07 -0800 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2010-02-19 16:00:07 -0800 |
commit | 7fc3d51bf5e021223d56304b6ac047f05acfc7bd (patch) | |
tree | f9f5b0853b0f79b2a8220215a91a608e26e78054 | |
parent | 1e288e68a3d13d00a3014c0c0e0ddf308b1caabd (diff) | |
download | ti-7fc3d51bf5e021223d56304b6ac047f05acfc7bd.tar.gz |
wl1271: Clear signal field after freeing the object
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | wilink_6_1/stad/src/Ctrl_Interface/CmdHndlr.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/wilink_6_1/stad/src/Ctrl_Interface/CmdHndlr.c b/wilink_6_1/stad/src/Ctrl_Interface/CmdHndlr.c index b60fa34..f2eb7cf 100644 --- a/wilink_6_1/stad/src/Ctrl_Interface/CmdHndlr.c +++ b/wilink_6_1/stad/src/Ctrl_Interface/CmdHndlr.c @@ -278,10 +278,11 @@ TI_STATUS cmdHndlr_InsertCommand (TI_HANDLE hCmdHndlr, eStatus = que_Enqueue (pCmdHndlr->hCmdQueue, (TI_HANDLE)pNewCmd); if (eStatus != TI_OK) { - context_LeaveCriticalSection (pCmdHndlr->hContext); /* Leave critical section */ os_printf("cmdPerform: Failed to enqueue new command\n"); os_SignalObjectFree (pCmdHndlr->hOs, pNewCmd->pSignalObject); + pNewCmd->pSignalObject = NULL; os_memoryFree (pCmdHndlr->hOs, pNewCmd, sizeof (TConfigCommand)); + context_LeaveCriticalSection (pCmdHndlr->hContext); /* Leave critical section */ return TI_NOK; } @@ -315,20 +316,21 @@ TI_STATUS cmdHndlr_InsertCommand (TI_HANDLE hCmdHndlr, os_SignalObjectWait (pCmdHndlr->hOs, pNewCmd->pSignalObject); /* After "wait" - the command has already been processed by the drivers' context */ - /* Indicate the end of command process, from adding it to the queue until get return status form it */ - pNewCmd->bWaitFlag = TI_FALSE; + /* Indicate the end of command process, from adding it to the queue until get return status form it */ + pNewCmd->bWaitFlag = TI_FALSE; /* Copy the return code */ eStatus = pNewCmd->return_code; /* Free signalling object and command structure */ os_SignalObjectFree (pCmdHndlr->hOs, pNewCmd->pSignalObject); + pNewCmd->pSignalObject = NULL; - /* If command not completed in this context (Async) don't free the command memory */ - if(COMMAND_PENDING != pNewCmd->eCmdStatus) - { - os_memoryFree (pCmdHndlr->hOs, pNewCmd, sizeof (TConfigCommand)); - } + /* If command not completed in this context (Async) don't free the command memory */ + if(COMMAND_PENDING != pNewCmd->eCmdStatus) + { + os_memoryFree (pCmdHndlr->hOs, pNewCmd, sizeof (TConfigCommand)); + } /* Return to calling process with command return code */ return eStatus; |