pkarashchenko commented on a change in pull request #5171:
URL: https://github.com/apache/incubator-nuttx/pull/5171#discussion_r779019294
##########
File path: sched/semaphore/sem_holder.c
##########
@@ -86,30 +87,36 @@ static inline FAR struct semholder_s
*nxsem_allocholder(sem_t *sem)
g_freeholders = pholder->flink;
pholder->flink = sem->hhead;
sem->hhead = pholder;
-
- /* Make sure the initial count is zero */
-
- pholder->counts = 0;
}
#else
if (sem->holder[0].htcb == NULL)
{
pholder = &sem->holder[0];
- pholder->counts = 0;
}
else if (sem->holder[1].htcb == NULL)
{
pholder = &sem->holder[1];
- pholder->counts = 0;
}
#endif
else
{
serr("ERROR: Insufficient pre-allocated holders\n");
pholder = NULL;
+ DEBUGASSERT(pholder != NULL);
Review comment:
`DEBUGASSERT(pholder != NULL);` here does not make any sense. It is
equivalent to `DEBUGASSERT(0);`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]