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 2022/04/19 08:34:08 UTC

[GitHub] [incubator-nuttx-apps] no1wudi opened a new pull request, #1144: system/i2c: Fix fd leak in i2ccmd_reset

no1wudi opened a new pull request, #1144:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1144

   ## Summary
   Close fd before return.
   ## Impact
   i2ccmd_reset
   ## Testing
   CI
   


-- 
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-apps] pkarashchenko merged pull request #1144: system/i2c: Fix fd leak in i2ccmd_reset

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged PR #1144:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1144


-- 
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-apps] pkarashchenko commented on a diff in pull request #1144: system/i2c: Fix fd leak in i2ccmd_reset

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #1144:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1144#discussion_r852801480


##########
system/i2c/i2c_reset.c:
##########
@@ -60,6 +62,13 @@ int i2ccmd_reset(FAR struct i2ctool_s *i2ctool, int argc, char **argv)
       i2ctool_printf(i2ctool, "Failed to send the reset command\n");
     }
 
+  ret = close(fd);
+

Review Comment:
   ```suggestion
   ```



-- 
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-apps] pkarashchenko commented on a diff in pull request #1144: system/i2c: Fix fd leak in i2ccmd_reset

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #1144:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1144#discussion_r852772588


##########
system/i2c/i2c_reset.c:
##########
@@ -53,7 +55,15 @@ int i2ccmd_reset(FAR struct i2ctool_s *i2ctool, int argc, char **argv)
   ret = i2cdev_reset(fd);
   if (ret == OK)
     {
-      i2ctool_printf(i2ctool, "Reset command sent successfully\n");
+      if (close(fd) == 0)

Review Comment:
   I think we should close even if `i2cdev_reset` fails



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