You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/01 11:23:58 UTC

[GitHub] [incubator-nuttx] GUIDINGLI opened a new pull request #4017: rpmsg_socket: fix rpmsg_socket_device_destroy() multi-access

GUIDINGLI opened a new pull request #4017:
URL: https://github.com/apache/incubator-nuttx/pull/4017


   
   ## Summary
   
   rpmsg_socket: fix rpmsg_socket_device_destroy() multi-access
   
   Reason:
   When user call rpmsg_socket_close() at the same time
   rpmsg_socket_ns_unbind() is called by remote CPU,
   then will meet multi-access to rpmsg_socket_device_destroy()
   
   Fix:
   reuse recvlock to handle this
   
   Change-Id: I8f33658f19c56a4000382ff9355ff052c45afea0
   Signed-off-by: ligd <li...@xiaomi.com>
   
   ## Impact
   
   ## Testing
   
   


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



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #4017: rpmsg_socket: fix rpmsg_socket_device_destroy() multi-access

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #4017:
URL: https://github.com/apache/incubator-nuttx/pull/4017#discussion_r662980685



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -386,7 +386,14 @@ static int rpmsg_socket_ept_cb(FAR struct rpmsg_endpoint *ept,
 static inline void rpmsg_socket_destroy_ept(
                     FAR struct rpmsg_socket_conn_s *conn)
 {
-  if (conn && conn->ept.rdev)
+  if (!conn)

Review comment:
       Good point. We should update the CS.
   
   It is a readability issue
   
   ```
   find . -type f | xargs grep -E '\(\!' | wc -l
   4875
   find . -type f | xargs grep -E '\(.* .= NULL' | wc -l
   6786
   ```




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



[GitHub] [incubator-nuttx] GUIDINGLI commented on a change in pull request #4017: rpmsg_socket: fix rpmsg_socket_device_destroy() multi-access

Posted by GitBox <gi...@apache.org>.
GUIDINGLI commented on a change in pull request #4017:
URL: https://github.com/apache/incubator-nuttx/pull/4017#discussion_r663384926



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -386,7 +386,14 @@ static int rpmsg_socket_ept_cb(FAR struct rpmsg_endpoint *ept,
 static inline void rpmsg_socket_destroy_ept(
                     FAR struct rpmsg_socket_conn_s *conn)
 {
-  if (conn && conn->ept.rdev)
+  if (!conn)

Review comment:
       If this you should update the guideline first, and add the rules to checkpatch.
   For this time, I will follow old rules.
   So this is not one issue, and don't need to change my patch for this time.




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



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #4017: rpmsg_socket: fix rpmsg_socket_device_destroy() multi-access

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #4017:
URL: https://github.com/apache/incubator-nuttx/pull/4017#discussion_r662534829



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -386,7 +386,14 @@ static int rpmsg_socket_ept_cb(FAR struct rpmsg_endpoint *ept,
 static inline void rpmsg_socket_destroy_ept(
                     FAR struct rpmsg_socket_conn_s *conn)
 {
-  if (conn && conn->ept.rdev)
+  if (!conn)

Review comment:
       ```suggestion
     if (conn == NULL)
   ```




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



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #4017: rpmsg_socket: fix rpmsg_socket_device_destroy() multi-access

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #4017:
URL: https://github.com/apache/incubator-nuttx/pull/4017


   


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



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4017: rpmsg_socket: fix rpmsg_socket_device_destroy() multi-access

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4017:
URL: https://github.com/apache/incubator-nuttx/pull/4017#discussion_r663397544



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -386,7 +386,14 @@ static int rpmsg_socket_ept_cb(FAR struct rpmsg_endpoint *ept,
 static inline void rpmsg_socket_destroy_ept(
                     FAR struct rpmsg_socket_conn_s *conn)
 {
-  if (conn && conn->ept.rdev)
+  if (!conn)

Review comment:
       @davids5 there are many places which check the pointer by if (p) or if (!p), so please send the suggestion to the mail list and get approved before we enforce your personal code style rule.




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



[GitHub] [incubator-nuttx] GUIDINGLI commented on a change in pull request #4017: rpmsg_socket: fix rpmsg_socket_device_destroy() multi-access

Posted by GitBox <gi...@apache.org>.
GUIDINGLI commented on a change in pull request #4017:
URL: https://github.com/apache/incubator-nuttx/pull/4017#discussion_r662712529



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -386,7 +386,14 @@ static int rpmsg_socket_ept_cb(FAR struct rpmsg_endpoint *ept,
 static inline void rpmsg_socket_destroy_ept(
                     FAR struct rpmsg_socket_conn_s *conn)
 {
-  if (conn && conn->ept.rdev)
+  if (!conn)

Review comment:
       If the coding guideline say this, show me.




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