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 2021/07/01 19:02:27 UTC

[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #4021: sched/waitpid: handle waitpid waitting tcb->group is NULL

davids5 commented on a change in pull request #4021:
URL: https://github.com/apache/incubator-nuttx/pull/4021#discussion_r662526374



##########
File path: sched/sched/sched_waitid.c
##########
@@ -167,9 +167,11 @@ int nx_waitid(int idtype, id_t id, FAR siginfo_t *info, int options)
        */
 
       ctcb = nxsched_get_tcb((pid_t)id);
-      if (ctcb != NULL)
+      if (ctcb && ctcb->group)

Review comment:
       ```suggestion
         if (ctcb != NULL && ctcb->group != NULL)
   ```

##########
File path: sched/sched/sched_waitpid.c
##########
@@ -230,7 +234,7 @@ pid_t nx_waitpid(pid_t pid, int *stat_loc, int options)
        */
 
       ctcb = nxsched_get_tcb(pid);
-      if (ctcb != NULL)
+      if (ctcb && ctcb->group)

Review comment:
       Same

##########
File path: sched/sched/sched_waitid.c
##########
@@ -167,9 +167,11 @@ int nx_waitid(int idtype, id_t id, FAR siginfo_t *info, int options)
        */
 
       ctcb = nxsched_get_tcb((pid_t)id);
-      if (ctcb != NULL)
+      if (ctcb && ctcb->group)

Review comment:
       Please use the log form in this PR.

##########
File path: sched/sched/sched_waitpid.c
##########
@@ -273,8 +277,7 @@ pid_t nx_waitpid(pid_t pid, int *stat_loc, int options)
        */
 
       ctcb = nxsched_get_tcb(pid);
-
-      if (ctcb == NULL || ctcb->group->tg_ppid != rtcb->group->tg_pid)
+      if (!ctcb || !ctcb->group || ctcb->group->tg_ppid != rtcb->pid)

Review comment:
       Same

##########
File path: sched/sched/sched_waitid.c
##########
@@ -209,7 +211,7 @@ int nx_waitid(int idtype, id_t id, FAR siginfo_t *info, int options)
 
       ctcb = nxsched_get_tcb((pid_t)id);
 
-      if (ctcb == NULL || ctcb->group->tg_ppid != rtcb->group->tg_pid)
+      if (!ctcb || !ctcb->group || ctcb->group->tg_ppid != rtcb->pid)

Review comment:
       ```suggestion
         if (ctcb == NULL || ctcb->group == NULL || ctcb->group->tg_ppid != rtcb->pid)
   ```




-- 
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