Changeset f659921 in rtems


Ignore:
Timestamp:
Jan 20, 2010, 5:08:19 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
04fee31
Parents:
59f7e91
Message:

2010-01-20 Joel Sherrill <joel.sherrill@…>

Coverity Id 5

  • score/src/objectextendinformation.c: Check object_blocks for NULL to determine when to allocate object block table.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r59f7e91 rf659921  
     12010-01-20      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        Coverity Id 5
     4        * score/src/objectextendinformation.c: Check object_blocks for NULL to
     5        determine when to allocate object block table.
     6
    172010-01-20      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • cpukit/score/src/objectextendinformation.c

    r59f7e91 rf659921  
    6262   *  to block_count + 1 if the table needs to be extended.
    6363   */
    64 
    6564  minimum_index = _Objects_Get_index( information->minimum_id );
    6665  index_base    = minimum_index;
    6766  block         = 0;
    6867
    69   if ( information->maximum < minimum_index )
     68  /* if ( information->maximum < minimum_index ) */
     69  if ( information->object_blocks == NULL )
    7070    block_count = 0;
    7171  else {
     
    9595   * generate a fatal error depending on auto-extending being active.
    9696   */
    97 
    9897  block_size = information->allocation_size * information->size;
    9998  if ( information->auto_extend ) {
     
    108107   *  If the index_base is the maximum we need to grow the tables.
    109108   */
    110 
    111109  if (index_base >= information->maximum ) {
    112110    ISR_Level         level;
     
    137135     *  Up the block count and maximum
    138136     */
    139 
    140137    block_count++;
    141138
     
    143140     *  Allocate the tables and break it up.
    144141     */
    145 
    146142    block_size = block_count *
    147143           (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
     
    157153     *  Break the block into the various sections.
    158154     */
    159 
    160155    inactive_per_block = (uint32_t *) _Addresses_Add_offset(
    161156        object_blocks, block_count * sizeof(void*) );
     
    167162     *  in the copies.
    168163     */
    169 
    170164    block_count--;
    171165
     
    186180              information->local_table,
    187181              (information->maximum + minimum_index) * sizeof(Objects_Control *) );
    188     }
    189     else {
     182    } else {
    190183
    191184      /*
     
    200193     *  Initialise the new entries in the table.
    201194     */
    202 
    203195    object_blocks[block_count] = NULL;
    204196    inactive_per_block[block_count] = 0;
     
    236228   *  Assign the new object block to the object block table.
    237229   */
    238 
    239230  information->object_blocks[ block ] = new_object_block;
    240231
     
    242233   *  Initialize objects .. add to a local chain first.
    243234   */
    244 
    245235  _Chain_Initialize(
    246236    &Inactive,
     
    253243   *  Move from the local chain, initialise, then append to the inactive chain
    254244   */
    255 
    256245  index = index_base;
    257246
    258   while ( (the_object = (Objects_Control *) _Chain_Get( &Inactive ) ) != NULL ) {
     247  while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
    259248
    260249    the_object->id = _Objects_Build_id(
Note: See TracChangeset for help on using the changeset viewer.