Changeset 7552e77c in rtems


Ignore:
Timestamp:
Nov 18, 2013, 12:25:49 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
298d0fd
Parents:
79e2d9b
git-author:
Sebastian Huber <sebastian.huber@…> (11/18/13 12:25:49)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/31/14 06:29:42)
Message:

score: PR2151: _Thread_queue_Extract_with_proxy()

Avoid NULL pointer access.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/threadqextractwithproxy.c

    r79e2d9b r7552e77c  
    3232)
    3333{
    34   States_Control        state;
     34  Thread_queue_Control *the_thread_queue;
    3535
    36   state = the_thread->current_state;
     36  #if defined(RTEMS_MULTIPROCESSING)
     37    States_Control state;
    3738
    38   if ( _States_Is_waiting_on_thread_queue( state ) ) {
    39     #if defined(RTEMS_MULTIPROCESSING)
    40       if ( _States_Is_waiting_for_rpc_reply( state ) &&
    41            _States_Is_locally_blocked( state ) ) {
    42         Objects_Information                  *the_information;
    43         Objects_Thread_queue_Extract_callout  proxy_extract_callout;
     39    state = the_thread->current_state;
     40    if ( _States_Is_waiting_for_rpc_reply( state ) &&
     41         _States_Is_locally_blocked( state ) ) {
     42      Objects_Information                  *the_information;
     43      Objects_Thread_queue_Extract_callout  proxy_extract_callout;
    4444
    45         the_information = _Objects_Get_information_id( the_thread->Wait.id );
    46         proxy_extract_callout =
    47           (Objects_Thread_queue_Extract_callout) the_information->extract;
     45      the_information = _Objects_Get_information_id( the_thread->Wait.id );
     46      proxy_extract_callout = the_information->extract;
    4847
    49         if ( proxy_extract_callout )
    50           (*proxy_extract_callout)( the_thread );
    51       }
    52     #endif
    53     _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
     48      if ( proxy_extract_callout != NULL )
     49        (*proxy_extract_callout)( the_thread );
     50    }
     51  #endif
    5452
    55     return true;
     53  the_thread_queue = the_thread->Wait.queue;
     54  if ( the_thread_queue != NULL ) {
     55    return _Thread_queue_Extract( the_thread_queue, the_thread );
     56  } else {
     57    return false;
    5658  }
    57   return false;
    5859}
Note: See TracChangeset for help on using the changeset viewer.