Skip to content

Commit dd4b01f

Browse files
committed
boot_serial: Initialize state with boot_state_init
Replace boot_state_clear with boot_state_init, where used for initialization and add boot_state_clear to remove state after use. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
1 parent a312656 commit dd4b01f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

boot/boot_serial/src/boot_serial.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ bs_list_set(uint8_t op, char *buf, int len)
660660
bool area_opened = false;
661661

662662
state = boot_get_loader_state();
663-
boot_state_clear(state);
663+
boot_state_init(state);
664664

665665
rc = boot_open_all_flash_areas(state);
666666
if (rc != 0) {
@@ -696,6 +696,7 @@ bs_list_set(uint8_t op, char *buf, int len)
696696
if (area_opened) {
697697
boot_close_all_flash_areas(state);
698698
}
699+
boot_state_clear(state);
699700

700701
if (rc != 0) {
701702
bs_rc_rsp(rc);

0 commit comments

Comments
 (0)