summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-04-17 10:00:15 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-04-17 19:51:11 +0200
commit3d73642d9e341a4c65fb86a15d696686e7f28d6d (patch)
tree96f693e3e80705a205e5b4192a452e80925875af /cpukit/sapi/src
parentCanonicalize config.h include (diff)
downloadrtems-3d73642d9e341a4c65fb86a15d696686e7f28d6d.tar.bz2
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')
-rw-r--r--cpukit/sapi/src/extensioncreate.c14
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;
}