Skip to content

Commit

Permalink
Add description about overrun warning in queue.c (#869)
Browse files Browse the repository at this point in the history
* Add description about overrun warning in queue.c

* Remove the unreachable configASSERT

* Code review suggestions

Signed-off-by: Gaurav Aggarwal <[email protected]>

* Fix formatting

Signed-off-by: Gaurav Aggarwal <[email protected]>

---------

Signed-off-by: Gaurav Aggarwal <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
Co-authored-by: Soren Ptak <[email protected]>
Co-authored-by: Rahul Kar <[email protected]>
Co-authored-by: Gaurav Aggarwal <[email protected]>
  • Loading branch information
5 people authored Dec 7, 2023
1 parent 93ef558 commit 15af8e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 15af8e0

Please sign in to comment.