You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xiaoxiang781216 (via GitHub)" <gi...@apache.org> on 2023/09/11 12:56:26 UTC

[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #10585: pm: fix issue that system crash when passed invalid relpath value

xiaoxiang781216 commented on code in PR #10585:
URL: https://github.com/apache/nuttx/pull/10585#discussion_r1321509232


##########
drivers/power/pm/pm_procfs.c:
##########
@@ -159,6 +161,23 @@ static FAR const char *g_pm_state[PM_COUNT] =
  * Private Functions
  ****************************************************************************/
 
+static int pm_path_validate(FAR const char *relpath)
+{
+  int index = -1;
+
+  for (int i = 0; i < nitems(g_pm_files); i++)

Review Comment:
   let's remove index and return i directly after match.



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