summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c/src/exec/posix/inline/mutex.inl5
-rw-r--r--c/src/exec/posix/inline/rtems/posix/mutex.inl5
-rw-r--r--cpukit/posix/inline/rtems/posix/mutex.inl5
3 files changed, 15 insertions, 0 deletions
diff --git a/c/src/exec/posix/inline/mutex.inl b/c/src/exec/posix/inline/mutex.inl
index ecbf039a45..baeb960858 100644
--- a/c/src/exec/posix/inline/mutex.inl
+++ b/c/src/exec/posix/inline/mutex.inl
@@ -51,6 +51,11 @@ RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
{
int status;
+ if ( !id ) {
+ *location = OBJECTS_ERROR;
+ return (POSIX_Mutex_Control *) 0;
+ }
+
if ( *id == PTHREAD_MUTEX_INITIALIZER ) {
/*
* Do an "auto-create" here.
diff --git a/c/src/exec/posix/inline/rtems/posix/mutex.inl b/c/src/exec/posix/inline/rtems/posix/mutex.inl
index ecbf039a45..baeb960858 100644
--- a/c/src/exec/posix/inline/rtems/posix/mutex.inl
+++ b/c/src/exec/posix/inline/rtems/posix/mutex.inl
@@ -51,6 +51,11 @@ RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
{
int status;
+ if ( !id ) {
+ *location = OBJECTS_ERROR;
+ return (POSIX_Mutex_Control *) 0;
+ }
+
if ( *id == PTHREAD_MUTEX_INITIALIZER ) {
/*
* Do an "auto-create" here.
diff --git a/cpukit/posix/inline/rtems/posix/mutex.inl b/cpukit/posix/inline/rtems/posix/mutex.inl
index ecbf039a45..baeb960858 100644
--- a/cpukit/posix/inline/rtems/posix/mutex.inl
+++ b/cpukit/posix/inline/rtems/posix/mutex.inl
@@ -51,6 +51,11 @@ RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
{
int status;
+ if ( !id ) {
+ *location = OBJECTS_ERROR;
+ return (POSIX_Mutex_Control *) 0;
+ }
+
if ( *id == PTHREAD_MUTEX_INITIALIZER ) {
/*
* Do an "auto-create" here.