From 229c257522002937d7696a18be7115a415ba2678 Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Fri, 20 Dec 2024 09:49:11 +0100 Subject: [PATCH] tests: drivers: flash: stm32: fix uninitialized variable Make sure not to accidentally enable WP by uninitialized variable during FLASH_STM32_EX_OP_SECTOR_WP call. Signed-off-by: Dawid Niedzwiecki --- tests/drivers/flash/stm32/src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/drivers/flash/stm32/src/main.c b/tests/drivers/flash/stm32/src/main.c index 4837af35a0eafb..9356535f8d9cac 100644 --- a/tests/drivers/flash/stm32/src/main.c +++ b/tests/drivers/flash/stm32/src/main.c @@ -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);