Skip to content

Commit 294a85b

Browse files
committed
[nrf fromlist] bootutil: Fix minor issues
Fix uninitialized variable warning as well as compile time issue, when the slotted dependencies are enabled. Upstream PR #: 2477 Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent 7c44ed0 commit 294a85b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

boot/bootutil/src/bootutil_public.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,9 @@ static int flash_area_to_image_slot(const struct flash_area *fa, uint32_t *slot)
563563

564564
++i;
565565
}
566+
567+
/* Image not found */
568+
*slot = UINT32_MAX;
566569
#else
567570
(void)fa;
568571
if (slot != NULL) {

boot/bootutil/src/loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ boot_verify_slot_dependencies(struct boot_loader_state *state, uint32_t slot)
612612

613613
#ifdef MCUBOOT_VERSION_CMP_USE_SLOT_NUMBER
614614
/* Validate against possible dependency slot values. */
615-
switch(dep->slot) {
615+
switch(dep.slot) {
616616
case VERSION_DEP_SLOT_ACTIVE:
617617
case VERSION_DEP_SLOT_PRIMARY:
618618
case VERSION_DEP_SLOT_SECONDARY:

0 commit comments

Comments
 (0)