You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/11/02 23:15:30 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7372: use CONFIG_DEBUG_FEATURES to cover param check

pkarashchenko commented on code in PR #7372:
URL: https://github.com/apache/incubator-nuttx/pull/7372#discussion_r1012374168


##########
sched/semaphore/sem_wait.c:
##########
@@ -72,10 +72,17 @@ int nxsem_wait(FAR sem_t *sem)
 {
   FAR struct tcb_s *rtcb = this_task();
   irqstate_t flags;
-  int ret = -EINVAL;
+  int ret;
 
   /* This API should not be called from interrupt handlers & idleloop */
 
+#ifdef CONFIG_DEBUG_FEATURES
+  if (sem == NULL)
+    {
+      return -EINVAL;
+    }
+#endif

Review Comment:
   https://pubs.opengroup.org/onlinepubs/7908799/xsh/sem_wait.html states:
   ```
   [EINVAL]
       The sem argument does not refer to a valid semaphore. 
   ```
   So that is not a debug feature



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org