diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-04-17 10:00:15 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-04-17 19:51:11 +0200 |
commit | 3d73642d9e341a4c65fb86a15d696686e7f28d6d (patch) | |
tree | 96f693e3e80705a205e5b4192a452e80925875af /cpukit/sapi/src/extensioncreate.c | |
parent | 80cf60efec79ac63cc3a26c6ad8f86790a385847 (diff) |
sapi: Add param check to rtems_extension_create()
Check that the extensions table is not NULL. Change format.
Update #3953.
Diffstat (limited to 'cpukit/sapi/src/extensioncreate.c')
-rw-r--r-- | cpukit/sapi/src/extensioncreate.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cpukit/sapi/src/extensioncreate.c b/cpukit/sapi/src/extensioncreate.c index 59f41d2ec2..5751f47bef 100644 --- a/cpukit/sapi/src/extensioncreate.c +++ b/cpukit/sapi/src/extensioncreate.c @@ -32,15 +32,21 @@ rtems_status_code rtems_extension_create( { Extension_Control *the_extension; - if ( !id ) + if ( !rtems_is_name_valid( name ) ) { + return RTEMS_INVALID_NAME; + } + + if ( extension_table == NULL ) { return RTEMS_INVALID_ADDRESS; + } - if ( !rtems_is_name_valid( name ) ) - return RTEMS_INVALID_NAME; + if ( id == NULL ) { + return RTEMS_INVALID_ADDRESS; + } the_extension = _Extension_Allocate(); - if ( !the_extension ) { + if ( the_extension == NULL ) { _Objects_Allocator_unlock(); return RTEMS_TOO_MANY; } |