xiaoxiang781216 commented on a change in pull request #5425:
URL: https://github.com/apache/incubator-nuttx/pull/5425#discussion_r800220542



##########
File path: drivers/pipes/pipe.c
##########
@@ -155,69 +131,34 @@ static int pipe_register(size_t bufsize, int flags,
   int pipeno;
   int ret;
 
-  /* Get exclusive access to the pipe allocation data */
-
-  ret = nxsem_wait(&g_pipesem);
-  if (ret < 0)
-    {
-      goto errout;
-    }
-
   /* Allocate a minor number for the pipe device */
 
   pipeno = pipe_allocate();
   if (pipeno < 0)
     {
-      ret = pipeno;
-      goto errout_with_sem;
+      return pipeno;
     }
 
   /* Create a pathname to the pipe device */
 
   snprintf(devname, namesize, CONFIG_DEV_PIPE_VFS_PATH"/%d", pipeno);
 
-  /* Check if the pipe device has already been created */
+  /* Allocate and initialize a new device structure instance */
 
-  if ((g_pipecreated & (1 << pipeno)) == 0)
+  dev = pipecommon_allocdev(bufsize);
+  if (!dev)

Review comment:
       Done.




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