Skip to content

Commit

Permalink
fix MPU wrapper for vTaskDelete for calling task deletion (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
kar-rahul-aws authored Aug 8, 2023
1 parent b5f670f commit 6f35865
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions portable/Common/mpu_wrappers_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1360,12 +1360,12 @@
xInternalTaskHandle = xTaskGetCurrentTaskHandle();
lIndex = MPU_GetIndexForTaskHandle( xInternalTaskHandle );

vTaskDelete( xInternalTaskHandle );

if( lIndex != -1 )
{
MPU_SetIndexFreeInKernelObjectPool( lIndex );
}

vTaskDelete( xInternalTaskHandle );
}
else
{
Expand All @@ -1377,8 +1377,8 @@

if( xInternalTaskHandle != NULL )
{
vTaskDelete( xInternalTaskHandle );
MPU_SetIndexFreeInKernelObjectPool( CONVERT_TO_INTERNAL_INDEX( lIndex ) );
vTaskDelete( xInternalTaskHandle );
}
}
}
Expand Down

0 comments on commit 6f35865

Please sign in to comment.