Skip to content

Commit 15af8e0

Browse files
chinglee-iotUbuntuSkptakkar-rahul-awsaggarg
authored
Add description about overrun warning in queue.c (FreeRTOS#869)
* 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]>
1 parent 93ef558 commit 15af8e0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

queue.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,14 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
18491849
* again, but only as low as the next highest priority
18501850
* task that is waiting for the same mutex. */
18511851
uxHighestWaitingPriority = prvGetDisinheritPriorityAfterTimeout( pxQueue );
1852+
1853+
/* vTaskPriorityDisinheritAfterTimeout uses the uxHighestWaitingPriority
1854+
* parameter to index pxReadyTasksLists when adding the task holding
1855+
* mutex to the ready list for its new priority. Coverity thinks that
1856+
* it can result in out-of-bounds access which is not true because
1857+
* uxHighestWaitingPriority, as returned by prvGetDisinheritPriorityAfterTimeout,
1858+
* is capped at ( configMAX_PRIORITIES - 1 ). */
1859+
/* coverity[overrun] */
18521860
vTaskPriorityDisinheritAfterTimeout( pxQueue->u.xSemaphore.xMutexHolder, uxHighestWaitingPriority );
18531861
}
18541862
taskEXIT_CRITICAL();

0 commit comments

Comments
 (0)