pkarashchenko commented on a change in pull request #5718:
URL: https://github.com/apache/incubator-nuttx/pull/5718#discussion_r824870134



##########
File path: drivers/can/can.c
##########
@@ -407,46 +406,48 @@ static int can_open(FAR struct file *filep)
    * for this device, then perform hardware initialization.
    */
 
-  if (list_is_empty(&dev->cd_readers))
+  caninfo("ocount: %u\n", dev->cd_crefs);
+
+  if (dev->cd_crefs >= 255)
     {
-      caninfo("ocount: %d\n", 0);
+      /* Limit to no more than 255 opens */

Review comment:
       It was tracked before my changes, but was relying on the readers list. 
Now since the readers list is not updated in case of the write only we can't 
use the readers list any more




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