From 7fc3d51bf5e021223d56304b6ac047f05acfc7bd Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Fri, 19 Feb 2010 16:00:07 -0800 Subject: wl1271: Clear signal field after freeing the object Signed-off-by: Dmitry Shmidt --- wilink_6_1/stad/src/Ctrl_Interface/CmdHndlr.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'wilink_6_1/stad') 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; -- cgit v1.2.3