You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "pkarashchenko (via GitHub)" <gi...@apache.org> on 2023/09/18 05:27:17 UTC

[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #10668: signal: use work_cancel_sync() to fix used after free

pkarashchenko commented on code in PR #10668:
URL: https://github.com/apache/nuttx/pull/10668#discussion_r1328258414


##########
sched/wqueue/kwork_cancel.c:
##########
@@ -93,6 +96,21 @@ static int work_qcancel(FAR struct kwork_wqueue_s *wqueue,
       work->worker = NULL;
       ret = OK;
     }
+  else if (nthread > 0)
+    {
+      int wndx;
+
+      for (wndx = 0; wndx < nthread; wndx++)
+        {
+          if (wqueue->worker[wndx].work == work &&
+              wqueue->worker[wndx].pid != _SCHED_GETTID())

Review Comment:
   Why _SCHED_GETTID macro is used? It is not a libc call, so we should call nx call directly here



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