Fix: Invalidate MPU object pool entry on timer delete in MPU wrappers v2

This commit is contained in:
Anubhav Rawal 2026-05-06 16:26:57 -07:00
parent a8c9d35152
commit 63017388f1

View file

@ -3541,6 +3541,15 @@
pxParams->xOptionalValue,
pxParams->pxHigherPriorityTaskWoken,
pxParams->xTicksToWait );
/* Timer deletion is asynchronous - eagerly invalidate the
* object pool entry only if the delete command was successfully
* queued, to prevent stale handle access after the timer daemon
* frees the Timer_t. */
if( ( xReturn == pdPASS ) && ( pxParams->xCommandID == tmrCOMMAND_DELETE ) )
{
MPU_SetIndexFreeInKernelObjectPool( CONVERT_TO_INTERNAL_INDEX( lIndex ) );
}
}
}
}