Skip to content

Commit a5ef464

Browse files
committed
update: fix warning-only build regressions
1 parent 4c704a9 commit a5ef464

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/update_flash.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ static int RAMFUNCTION wolfBoot_swap_and_final_erase(int resume)
426426
struct wolfBoot_image update[1];
427427
struct wolfBoot_image swap[1];
428428
uint8_t updateState = IMG_STATE_NEW;
429-
int ret = 0;
430429
int eraseLen = (WOLFBOOT_SECTOR_SIZE
431430
#ifdef NVM_FLASH_WRITEONCE /* need to erase the redundant sector too */
432431
* 2
@@ -499,6 +498,7 @@ static int RAMFUNCTION wolfBoot_swap_and_final_erase(int resume)
499498
wb_flash_erase(boot, WOLFBOOT_PARTITION_SIZE - eraseLen, eraseLen);
500499

501500
#ifdef EXT_ENCRYPTED
501+
int ret;
502502
/* Initialize encryption with the saved key */
503503
ret = wolfBoot_set_encrypt_key((uint8_t*)tmpBuffer,
504504
(uint8_t*)&tmpBuffer[ENCRYPT_KEY_SIZE / sizeof(uint32_t)]);
@@ -1221,10 +1221,9 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
12211221
wolfBoot_zeroize(key, sizeof(key));
12221222
wolfBoot_zeroize(nonce, sizeof(nonce));
12231223
if (ret != 0)
1224-
goto out;
1224+
return ret;
12251225
#endif
12261226
#endif /* DISABLE_BACKUP */
1227-
out:
12281227
#ifdef EXT_ENCRYPTED
12291228
/* Make sure we leave the global IV offset in its normal state. */
12301229
wolfBoot_enable_fallback_iv(0);

0 commit comments

Comments
 (0)