diff options
author | Josh Oguin <josh.oguin@oarcorp.com> | 2014-10-28 11:38:54 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-11-26 07:51:56 -0600 |
commit | ba3b6fdc898730986a6ff15dc4c3b77ccbea035e (patch) | |
tree | f0563b28eff96a94542c902070c9e0e16e1f8c39 | |
parent | shell: Include missing header (diff) | |
download | rtems-ba3b6fdc898730986a6ff15dc4c3b77ccbea035e.tar.bz2 |
apimutex.c: Add _Assert for NULL pointer access
CodeSonar detects a possible NULL deference here. But it should never
occur in tested code. Memory for the API Mutexes is reserved by confdefs.h
and are all preallocated when the class of objects is initialized.
Allocating a single instance should never fail.
-rw-r--r-- | cpukit/score/src/apimutex.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cpukit/score/src/apimutex.c b/cpukit/score/src/apimutex.c index ec2fbdc3ec..eb0663d2a2 100644 --- a/cpukit/score/src/apimutex.c +++ b/cpukit/score/src/apimutex.c @@ -61,6 +61,8 @@ void _API_Mutex_Allocate( mutex = (API_Mutex_Control *) _Objects_Allocate_unprotected( &_API_Mutex_Information ); + _Assert( mutex != NULL ); + _CORE_mutex_Initialize( &mutex->Mutex, NULL, &attr, false ); _Objects_Open_u32( &_API_Mutex_Information, &mutex->Object, 1 ); |