mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Event Groups: snapshot xEventGroupSetBits returning value while in vTaskSuspendAll (#1143)
Event Groups: snapshot xEventGroupSetBits returning value while in vTaskSuspendAll. Fixes uxEventBits dereference after event group deleted by higher priority thread.
This commit is contained in:
parent
d806240dfe
commit
d3052f1f50
2 changed files with 11 additions and 11 deletions
|
@ -551,7 +551,7 @@
|
|||
ListItem_t * pxNext;
|
||||
ListItem_t const * pxListEnd;
|
||||
List_t const * pxList;
|
||||
EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits;
|
||||
EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits, uxReturnBits;
|
||||
EventGroup_t * pxEventBits = xEventGroup;
|
||||
BaseType_t xMatchFound = pdFALSE;
|
||||
|
||||
|
@ -635,12 +635,15 @@
|
|||
/* Clear any bits that matched when the eventCLEAR_EVENTS_ON_EXIT_BIT
|
||||
* bit was set in the control word. */
|
||||
pxEventBits->uxEventBits &= ~uxBitsToClear;
|
||||
|
||||
/* Snapshot resulting bits. */
|
||||
uxReturnBits = pxEventBits->uxEventBits;
|
||||
}
|
||||
( void ) xTaskResumeAll();
|
||||
|
||||
traceRETURN_xEventGroupSetBits( pxEventBits->uxEventBits );
|
||||
traceRETURN_xEventGroupSetBits( uxReturnBits );
|
||||
|
||||
return pxEventBits->uxEventBits;
|
||||
return uxReturnBits;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue