summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/stm32/flash-stm32f100.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/stm32/flash-stm32f100.c b/chip/stm32/flash-stm32f100.c
index 1221bf1b50..4c9c39b8b8 100644
--- a/chip/stm32/flash-stm32f100.c
+++ b/chip/stm32/flash-stm32f100.c
@@ -641,7 +641,7 @@ int flash_set_protect(uint32_t mask, uint32_t flags)
EC_FLASH_PROTECT_RO_AT_BOOT))
return retval;
- if (mask & EC_FLASH_PROTECT_ALL_NOW) {
+ if (mask & flags & EC_FLASH_PROTECT_ALL_NOW) {
/*
* Since RO is already protected, protecting entire flash
* is effectively protecting RW.