From 6f3586516a42f556db04ae8c1f9394ef9f7e78c5 Mon Sep 17 00:00:00 2001 From: kar-rahul-aws <118818625+kar-rahul-aws@users.noreply.github.com> Date: Tue, 8 Aug 2023 12:18:34 +0530 Subject: [PATCH] fix MPU wrapper for vTaskDelete for calling task deletion (#745) --- portable/Common/mpu_wrappers_v2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/portable/Common/mpu_wrappers_v2.c b/portable/Common/mpu_wrappers_v2.c index 3cebd56c7f6..a9c317055d1 100644 --- a/portable/Common/mpu_wrappers_v2.c +++ b/portable/Common/mpu_wrappers_v2.c @@ -1360,12 +1360,12 @@ xInternalTaskHandle = xTaskGetCurrentTaskHandle(); lIndex = MPU_GetIndexForTaskHandle( xInternalTaskHandle ); - vTaskDelete( xInternalTaskHandle ); - if( lIndex != -1 ) { MPU_SetIndexFreeInKernelObjectPool( lIndex ); } + + vTaskDelete( xInternalTaskHandle ); } else { @@ -1377,8 +1377,8 @@ if( xInternalTaskHandle != NULL ) { - vTaskDelete( xInternalTaskHandle ); MPU_SetIndexFreeInKernelObjectPool( CONVERT_TO_INTERNAL_INDEX( lIndex ) ); + vTaskDelete( xInternalTaskHandle ); } } }