aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/flash/nor/nrf51.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flash/nor/nrf51.c b/src/flash/nor/nrf51.c
index 2a4b887..adb4004 100644
--- a/src/flash/nor/nrf51.c
+++ b/src/flash/nor/nrf51.c
@@ -629,7 +629,7 @@ static int nrf51_write_page(struct flash_bank *bank, uint32_t offset, const uint
struct flash_sector *sector = nrf51_find_sector_by_address(bank, offset);
if (!sector)
- goto error;
+ return ERROR_FLASH_SECTOR_INVALID;
if (sector->is_protected)
goto error;