Permalink
Browse files

wl1271: Clear signal field after freeing the object

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
  • Loading branch information...
1 parent 1e288e6 commit 7fc3d51bf5e021223d56304b6ac047f05acfc7bd Dmitry Shmidt committed Feb 20, 2010
Showing with 10 additions and 8 deletions.
  1. +10 −8 wilink_6_1/stad/src/Ctrl_Interface/CmdHndlr.c
View
18 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;

0 comments on commit 7fc3d51

Please sign in to comment.