mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
score: Use _Workspace_Allocate_or_fatal_error()
Use _Workspace_Allocate_or_fatal_error() consistently in case auto extend is turned off. This helps to avoid undefined behaviour in _API_Mutex_Allocate() in case _API_Mutex_Information() fails.
This commit is contained in:
committed by
Gedare Bloom
parent
b6b8cd7fb1
commit
0e75aae563
@@ -142,11 +142,14 @@ void _Objects_Extend_information(
|
||||
block_size = block_count *
|
||||
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
|
||||
((maximum + minimum_index) * sizeof(Objects_Control *));
|
||||
object_blocks = (void**) _Workspace_Allocate( block_size );
|
||||
|
||||
if ( !object_blocks ) {
|
||||
_Workspace_Free( new_object_block );
|
||||
return;
|
||||
if ( information->auto_extend ) {
|
||||
object_blocks = _Workspace_Allocate( block_size );
|
||||
if ( !object_blocks ) {
|
||||
_Workspace_Free( new_object_block );
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
object_blocks = _Workspace_Allocate_or_fatal_error( block_size );
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user