Changeset ee870077 in rtems


Ignore:
Timestamp:
Dec 22, 2014, 12:50:31 AM (5 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11, master
Children:
c0e01a28
Parents:
9d090fb7
git-author:
Chris Johns <chrisj@…> (12/22/14 00:50:31)
git-committer:
Gedare Bloom <gedare@…> (02/24/15 17:53:29)
Message:

Panic on RTEMS_FAST_MUTEX network semaphore claim/release.

Fix the code to panic rather than perform a bad access if the network
semaphore is accessed without the stack being intialised.

Closes #2229.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/rtems/rtems_glue.c

    r9d090fb7 ree870077  
    118118{
    119119#ifdef RTEMS_FAST_MUTEX
    120         uint32_t nest_count = the_networkSemaphore->Core_control.mutex.nest_count;
     120        uint32_t nest_count;
    121121        uint32_t i;
    122122
     123        nest_count =
     124                the_networkSemaphore ?
     125                the_networkSemaphore->Core_control.mutex.nest_count : 0;
    123126        for (i = 0; i < nest_count; ++i) {
    124127                rtems_bsdnet_semaphore_release();
     
    380383#endif
    381384        _ISR_Disable (level);
     385        if (!the_networkSemaphore)
     386                rtems_panic ("rtems-net: network sema obtain: network not initialised\n");
    382387        executing = _Thread_Executing;
    383388        _CORE_mutex_Seize (
     
    415420
    416421        _Thread_Disable_dispatch();
     422        if (!the_networkSemaphore)
     423                rtems_panic ("rtems-net: network sema obtain: network not initialised\n");
    417424        i = _CORE_mutex_Surrender (
    418425                &the_networkSemaphore->Core_control.mutex,
Note: See TracChangeset for help on using the changeset viewer.