@@ -2285,7 +2285,7 @@ void * vSocketClose( FreeRTOS_Socket_t * pxSocket )
22852285
22862286 if ( pxSocketToDelete -> u .xTCP .eTCPState == eTCP_LISTEN )
22872287 {
2288- pxIterator = listGET_NEXT ( pxEnd );
2288+ pxIterator = listGET_HEAD_ENTRY ( & xBoundTCPSocketsList );
22892289
22902290 while ( pxIterator != pxEnd )
22912291 {
@@ -2309,7 +2309,7 @@ void * vSocketClose( FreeRTOS_Socket_t * pxSocket )
23092309 }
23102310 else
23112311 {
2312- for ( pxIterator = listGET_NEXT ( pxEnd );
2312+ for ( pxIterator = listGET_HEAD_ENTRY ( & xBoundTCPSocketsList );
23132313 pxIterator != pxEnd ;
23142314 pxIterator = listGET_NEXT ( pxIterator ) )
23152315 {
@@ -3054,7 +3054,7 @@ static const ListItem_t * pxListFindListItemWithValue( const List_t * pxList,
30543054 /* coverity[misra_c_2012_rule_11_3_violation] */
30553055 const ListItem_t * pxEnd = ( ( const ListItem_t * ) & ( pxList -> xListEnd ) );
30563056
3057- for ( pxIterator = listGET_NEXT ( pxEnd );
3057+ for ( pxIterator = listGET_HEAD_ENTRY ( pxList );
30583058 pxIterator != pxEnd ;
30593059 pxIterator = listGET_NEXT ( pxIterator ) )
30603060 {
@@ -4961,7 +4961,7 @@ void vSocketWakeUpUser( FreeRTOS_Socket_t * pxSocket )
49614961
49624962 ( void ) ulLocalIP ;
49634963
4964- for ( pxIterator = listGET_NEXT ( pxEnd );
4964+ for ( pxIterator = listGET_HEAD_ENTRY ( & xBoundTCPSocketsList );
49654965 pxIterator != pxEnd ;
49664966 pxIterator = listGET_NEXT ( pxIterator ) )
49674967 {
@@ -6085,13 +6085,15 @@ BaseType_t FreeRTOS_GetIPType( ConstSocket_t xSocket )
60856085 {
60866086 const ListItem_t * pxIterator ;
60876087 const ListItem_t * pxEnd ;
6088+ const List_t * pxList ;
60886089
60896090 if ( xRound == 0 )
60906091 {
60916092 /* MISRA Ref 11.3.1 [Misaligned access] */
60926093 /* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-113 */
60936094 /* coverity[misra_c_2012_rule_11_3_violation] */
60946095 pxEnd = ( ( const ListItem_t * ) & ( xBoundUDPSocketsList .xListEnd ) );
6096+ pxList = & xBoundUDPSocketsList ;
60956097 }
60966098
60976099 #if ipconfigUSE_TCP == 1
@@ -6101,10 +6103,11 @@ BaseType_t FreeRTOS_GetIPType( ConstSocket_t xSocket )
61016103 /* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-113 */
61026104 /* coverity[misra_c_2012_rule_11_3_violation] */
61036105 pxEnd = ( ( const ListItem_t * ) & ( xBoundTCPSocketsList .xListEnd ) );
6106+ pxList = & xBoundTCPSocketsList ;
61046107 }
61056108 #endif /* ipconfigUSE_TCP == 1 */
61066109
6107- for ( pxIterator = listGET_NEXT ( pxEnd );
6110+ for ( pxIterator = listGET_HEAD_ENTRY ( pxList );
61086111 pxIterator != pxEnd ;
61096112 pxIterator = listGET_NEXT ( pxIterator ) )
61106113 {
0 commit comments