Skip to content

Commit fcb0a47

Browse files
authored
Merge pull request #4819 from whj4674672/pm
[pm] index should be less than PM_MODLUE_MAX_ID
2 parents 2341ba0 + 5d4260a commit fcb0a47

File tree

1 file changed

+1
-3
lines changed
  • components/drivers/pm

1 file changed

+1
-3
lines changed

components/drivers/pm/pm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,12 +836,10 @@ rt_uint32_t rt_pm_module_get_status(void)
836836
rt_uint32_t req_status = 0x00;
837837
pm = &_pm;
838838

839-
for (index = 0; index < 32; index ++)
839+
for (index = 0; index < PM_MODULE_MAX_ID; index ++)
840840
{
841841
if (pm->module_status[index].req_status == 0x01)
842842
req_status |= 1<<index;
843-
if (index >= PM_MODULE_MAX_ID)
844-
break;
845843
}
846844

847845
return req_status;

0 commit comments

Comments
 (0)