summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2010-02-19 16:06:03 -0800
committerDmitry Shmidt <dimitrysh@google.com>2010-02-19 16:06:03 -0800
commit8738984310461378d69db98d8fa75d38c43dd60e (patch)
tree3afd0d67a3dfb0ca24c41aaf96530d604f5cdfbd
parent5d969c3c4738de33d100a514cc06079c1fdaa0e7 (diff)
downloadwlan-8738984310461378d69db98d8fa75d38c43dd60e.tar.gz
wl1271: Clear signal field after freeing the object
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--wl1271/stad/src/Ctrl_Interface/CmdHndlr.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/wl1271/stad/src/Ctrl_Interface/CmdHndlr.c b/wl1271/stad/src/Ctrl_Interface/CmdHndlr.c
index 6966645..26db480 100644
--- a/wl1271/stad/src/Ctrl_Interface/CmdHndlr.c
+++ b/wl1271/stad/src/Ctrl_Interface/CmdHndlr.c
@@ -279,10 +279,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;
}
@@ -316,20 +317,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;