pussuw commented on code in PR #14859:
URL: https://github.com/apache/nuttx/pull/14859#discussion_r1849549993


##########
sched/addrenv/addrenv.c:
##########
@@ -422,14 +421,7 @@ void addrenv_take(FAR struct addrenv_s *addrenv)
 
 int addrenv_give(FAR struct addrenv_s *addrenv)
 {
-  irqstate_t flags;
-  int refs;
-
-  flags = enter_critical_section();
-  refs = --addrenv->refs;
-  leave_critical_section(flags);
-
-  return refs;
+  return atomic_fetch_sub(&addrenv->refs, 1);

Review Comment:
   Yes, this is the error.



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to