summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/msgqconstruct.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-09-30 16:22:04 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-10-01 18:05:58 +0200
commit71689a0775f39d65b3c9f0a81b58394d0b04e534 (patch)
treecea54dcebe2947cdd41bb98a9c4841915a4b44a8 /cpukit/rtems/src/msgqconstruct.c
parenttests: Add and use <rtems/testopts.h> (diff)
downloadrtems-71689a0775f39d65b3c9f0a81b58394d0b04e534.tar.bz2
rtems: Canonicalize name and id checks
Check the name followed by the id check in all create directives. Compare pointers against NULL. Fix formatting.
Diffstat (limited to 'cpukit/rtems/src/msgqconstruct.c')
-rw-r--r--cpukit/rtems/src/msgqconstruct.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpukit/rtems/src/msgqconstruct.c b/cpukit/rtems/src/msgqconstruct.c
index 61d0472e7c..82f6d2dfad 100644
--- a/cpukit/rtems/src/msgqconstruct.c
+++ b/cpukit/rtems/src/msgqconstruct.c
@@ -63,14 +63,14 @@ rtems_status_code _Message_queue_Create(
bool is_global;
#endif
- if ( id == NULL ) {
- return RTEMS_INVALID_ADDRESS;
- }
-
if ( !rtems_is_name_valid( config->name ) ) {
return RTEMS_INVALID_NAME;
}
+ if ( id == NULL ) {
+ return RTEMS_INVALID_ADDRESS;
+ }
+
if ( config->maximum_pending_messages == 0 ) {
return RTEMS_INVALID_NUMBER;
}