From 71689a0775f39d65b3c9f0a81b58394d0b04e534 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 30 Sep 2020 16:22:04 +0200 Subject: rtems: Canonicalize name and id checks Check the name followed by the id check in all create directives. Compare pointers against NULL. Fix formatting. --- cpukit/rtems/src/taskconstruct.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cpukit/rtems/src/taskconstruct.c') diff --git a/cpukit/rtems/src/taskconstruct.c b/cpukit/rtems/src/taskconstruct.c index 76ef8ce5d6..9b1fdec3ae 100644 --- a/cpukit/rtems/src/taskconstruct.c +++ b/cpukit/rtems/src/taskconstruct.c @@ -96,11 +96,13 @@ rtems_status_code _RTEMS_tasks_Create( RTEMS_API_Control *api; ASR_Information *asr; - if ( !id ) - return RTEMS_INVALID_ADDRESS; - - if ( !rtems_is_name_valid( config->name ) ) + if ( !rtems_is_name_valid( config->name ) ) { return RTEMS_INVALID_NAME; + } + + if ( id == NULL ) { + return RTEMS_INVALID_ADDRESS; + } /* * Core Thread Initialize insures we get the minimum amount of -- cgit v1.2.3