Skip to content

Commit d761d18

Browse files
authored
Remove unnecessary NULL check (#31)
Signed-off-by: Gaurav Aggarwal <[email protected]>
1 parent e921c4f commit d761d18

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_mutex.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,8 @@ int pthread_mutex_init( pthread_mutex_t * mutex,
148148
( void ) xSemaphoreCreateMutexStatic( &pxMutex->xMutex );
149149
}
150150

151-
/* Ensure that the FreeRTOS mutex was successfully created. */
152-
if( ( SemaphoreHandle_t ) &pxMutex->xMutex == NULL )
153-
{
154-
/* Failed to create mutex. Set error EAGAIN and free mutex object. */
155-
iStatus = EAGAIN;
156-
vPortFree( pxMutex );
157-
}
158-
else
159-
{
160-
/* Mutex successfully created. */
161-
pxMutex->xIsInitialized = pdTRUE;
162-
}
151+
/* Mutex successfully created. */
152+
pxMutex->xIsInitialized = pdTRUE;
163153
}
164154

165155
return iStatus;

0 commit comments

Comments
 (0)