From 42586664413d49d540526556ce042355b1916098 Mon Sep 17 00:00:00 2001 From: Harsh Soni <98403303+SoniHarsh1@users.noreply.github.com> Date: Wed, 17 Dec 2025 03:20:17 +0530 Subject: [PATCH] fix: Add missing macro guards in task.h - Add missing conditions to prevent unintended access to certain APIs in task.h - The condition is mentioned in the API description but was absent in the code --- include/task.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/task.h b/include/task.h index a25740e3bbd..d0ad2ca237f 100644 --- a/include/task.h +++ b/include/task.h @@ -602,12 +602,12 @@ typedef enum * \defgroup xTaskCreateRestricted xTaskCreateRestricted * \ingroup Tasks */ -#if ( portUSING_MPU_WRAPPERS == 1 ) +#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) BaseType_t xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION; #endif -#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) +#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) BaseType_t xTaskCreateRestrictedAffinitySet( const TaskParameters_t * const pxTaskDefinition, UBaseType_t uxCoreAffinityMask, TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;