diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-08-24 15:56:49 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-10-15 14:58:08 +0200 |
commit | 8d4faf90e8679aaa037d8c7af8d9b801c7a7a219 (patch) | |
tree | 07cce241649e49660112fa37e69b656687173d83 /cpukit/score/src/objectextendinformation.c | |
parent | sptests/sp39: Increase clock tick interval (diff) | |
download | rtems-8d4faf90e8679aaa037d8c7af8d9b801c7a7a219.tar.bz2 |
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.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/objectextendinformation.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cpukit/score/src/objectextendinformation.c b/cpukit/score/src/objectextendinformation.c index e93994cbf6..b94b699835 100644 --- a/cpukit/score/src/objectextendinformation.c +++ b/cpukit/score/src/objectextendinformation.c @@ -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 ); } /* |