Skip to content

Commit c6e5160

Browse files
authored
Merge pull request #388 from nchong/fix369
Fix out-by-one error in vmpu_mpu_push
2 parents 27fa33d + eaba2b6 commit c6e5160

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/vmpu/src/armv7m/vmpu_armv7m_mpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ bool vmpu_mpu_push(const MpuRegion * const region, uint8_t priority)
411411
uint8_t viable_slot = start_slot;
412412

413413
do {
414-
if (++g_mpu_slot > ARMv7M_MPU_REGIONS_MAX) {
414+
if (++g_mpu_slot >= ARMv7M_MPU_REGIONS_MAX) {
415415
g_mpu_slot = ARMv7M_MPU_REGIONS_STATIC;
416416
}
417417

0 commit comments

Comments
 (0)