Skip to content

Commit

Permalink
tests: drivers: flash: stm32: fix uninitialized variable
Browse files Browse the repository at this point in the history
Make sure not to accidentally enable WP by uninitialized variable during
FLASH_STM32_EX_OP_SECTOR_WP call.

Signed-off-by: Dawid Niedzwiecki <[email protected]>
  • Loading branch information
niedzwiecki-dawid authored and kartben committed Dec 25, 2024
1 parent 86adcb6 commit 229c257
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/drivers/flash/stm32/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ static void *flash_stm32_setup(void)
if (wp_status.protected_mask & sector_mask) {
TC_PRINT("Removing write protection\n");
wp_request.disable_mask = sector_mask;
wp_request.enable_mask = 0;

rc = flash_ex_op(flash_dev, FLASH_STM32_EX_OP_SECTOR_WP,
(uintptr_t)&wp_request, NULL);
Expand Down

0 comments on commit 229c257

Please sign in to comment.