diff options
author | chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> | 2023-12-07 12:52:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-07 12:52:21 +0300 |
commit | 15af8e072d7299d92a38a2f634c3bf3f095d3a32 (patch) | |
tree | 07a2b879a8785f5bef5ada20f6a4f31733920631 /queue.c | |
parent | 93ef558fa8484211bd1d78c06bbd14aae1b2ece5 (diff) |
Add description about overrun warning in queue.c (#869)
* Add description about overrun warning in queue.c
* Remove the unreachable configASSERT
* Code review suggestions
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
* Fix formatting
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-245.ap-northeast-1.compute.internal>
Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
Diffstat (limited to 'queue.c')
-rw-r--r-- | queue.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1849,6 +1849,14 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue, * again, but only as low as the next highest priority * task that is waiting for the same mutex. */ uxHighestWaitingPriority = prvGetDisinheritPriorityAfterTimeout( pxQueue ); + + /* vTaskPriorityDisinheritAfterTimeout uses the uxHighestWaitingPriority + * parameter to index pxReadyTasksLists when adding the task holding + * mutex to the ready list for its new priority. Coverity thinks that + * it can result in out-of-bounds access which is not true because + * uxHighestWaitingPriority, as returned by prvGetDisinheritPriorityAfterTimeout, + * is capped at ( configMAX_PRIORITIES - 1 ). */ + /* coverity[overrun] */ vTaskPriorityDisinheritAfterTimeout( pxQueue->u.xSemaphore.xMutexHolder, uxHighestWaitingPriority ); } taskEXIT_CRITICAL(); |