anchao commented on code in PR #10545:
URL: https://github.com/apache/nuttx/pull/10545#discussion_r1321452034


##########
fs/vfs/fs_eventfd.c:
##########
@@ -135,6 +135,7 @@ static FAR struct eventfd_priv_s *eventfd_allocdev(void)
 
       nxmutex_init(&dev->lock);
       nxmutex_lock(&dev->lock);
+      dev->crefs += 1;

Review Comment:
   These API such as `eventfd_allocdev()` is a help function, from api design, 
you do not get to decide how developers use it. If it will alloc once on init 
phase, then you should move the increment of the reference count to `eventfd()` 
not `eventfd_allocdev()`



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

Reply via email to