Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRTOS/FreeRTOS-Kernel.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Bartell <pbartell@amazon.com>2021-04-17 19:57:16 +0300
committerGitHub <noreply@github.com>2021-04-17 19:57:16 +0300
commit46f7feba815b49fca5f5884304a465844812f1ef (patch)
treed54448682975b6adde006c3fa4ca4324977006d1 /queue.c
parent99295c9ae8f40a1be7fd23de9171f820b6a42db6 (diff)
Replace configASSERT( pcQueueName ) in vQueueAddToRegistry with a NULL pointer check. (#313)
* Replace configASSERT( pcQueueName ) in vQueueAddToRegistry with a NULL pointer check. Fixes FreeRTOS/FreeRTOS-Kernel#311 * Make NULL checks consistent.
Diffstat (limited to 'queue.c')
-rw-r--r--queue.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/queue.c b/queue.c
index 2faa158e2..a60c6ca6b 100644
--- a/queue.c
+++ b/queue.c
@@ -2728,32 +2728,34 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
UBaseType_t ux;
configASSERT( xQueue );
- configASSERT( pcQueueName );
QueueRegistryItem_t * pxEntryToWrite = NULL;
- /* See if there is an empty space in the registry. A NULL name denotes
- * a free slot. */
- for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ )
+ if( pcQueueName != NULL )
{
- /* Replace an existing entry if the queue is already in the registry. */
- if( xQueueRegistry[ ux ].xHandle == xQueue )
- {
- pxEntryToWrite = &( xQueueRegistry[ ux ] );
- break;
- }
- /* Otherwise, store in the next empty location */
- else if( ( NULL == pxEntryToWrite ) && ( xQueueRegistry[ ux ].pcQueueName == NULL ) )
+ /* See if there is an empty space in the registry. A NULL name denotes
+ * a free slot. */
+ for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ )
{
- pxEntryToWrite = &( xQueueRegistry[ ux ] );
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
+ /* Replace an existing entry if the queue is already in the registry. */
+ if( xQueue == xQueueRegistry[ ux ].xHandle )
+ {
+ pxEntryToWrite = &( xQueueRegistry[ ux ] );
+ break;
+ }
+ /* Otherwise, store in the next empty location */
+ else if( ( pxEntryToWrite == NULL ) && ( xQueueRegistry[ ux ].pcQueueName == NULL ) )
+ {
+ pxEntryToWrite = &( xQueueRegistry[ ux ] );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
}
- if( NULL != pxEntryToWrite )
+ if( pxEntryToWrite == NULL )
{
/* Store the information on this queue. */
pxEntryToWrite->pcQueueName = pcQueueName;