xhh233 opened a new pull request, #22457:
URL: https://github.com/apache/nuttx/pull/22457

   ## Summary
   
   `pm_changestate()` returns the PM state on success in some paths and a 
negative errno on failure, but the three call sites in `pm_idle()` test `ret < 
0`. A positive non-`OK` return is therefore treated as success and the failed 
transition is not rolled back.
   
   Compare against `OK` instead, so any non-success return restores the 
previous state.
   
   ## Testing
   
   Source-level: all three sites are the only consumers of the 
`pm_changestate()` return value inside `pm_idle()`; the `newstate = oldstate` / 
`PM_NORMAL` rollbacks are unchanged for the failure path.
   
   Issue reference: #22209.


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