Skip to content

Commit 0287fd4

Browse files
de-nordicnvlsianpu
authored andcommitted
boot_serial: Fix double boot_loader_state init
Remove one memset and replace other one with boot_state_clear. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
1 parent f846e9e commit 0287fd4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

boot/boot_serial/src/boot_serial_encryption.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ decrypt_image_inplace(const struct flash_area *fa_p,
218218
size_t sect;
219219
struct flash_sector sector;
220220

221-
memset(&boot_data, 0, sizeof(struct boot_loader_state));
221+
boot_state_clear(state);
222222
memset(&_bs, 0, sizeof(struct boot_status));
223223

224224
/* Get size from last sector to know page/sector erase size */
@@ -233,7 +233,6 @@ decrypt_image_inplace(const struct flash_area *fa_p,
233233
FIH_RET(fih_rc);
234234
}
235235
#endif
236-
memset(&boot_data, 0, sizeof(struct boot_loader_state));
237236
/* Load the encryption keys into cache */
238237
rc = boot_enc_load(state, BOOT_SLOT_PRIMARY, hdr, fa_p, bs);
239238
if (rc < 0) {

0 commit comments

Comments
 (0)