Commit ec6dac50 authored by Dominik Ermel's avatar Dominik Ermel Committed by Fabio Utzig
Browse files

bootutil: Fix boot_find_status leaving flash area open



The commit fixes boot_find_status leaving flash area object in open
state on success.

Signed-off-by: default avatarDominik Ermel <dominik.ermel@nordicsemi.no>
parent 482921f7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -224,8 +224,9 @@ boot_find_status(int image_index, const struct flash_area **fap)

        off = boot_magic_off(*fap);
        rc = flash_area_read(*fap, off, magic, BOOT_MAGIC_SZ);
        if (rc != 0) {
        flash_area_close(*fap);

        if (rc != 0) {
            return rc;
        }

@@ -233,7 +234,6 @@ boot_find_status(int image_index, const struct flash_area **fap)
            return 0;
        }

        flash_area_close(*fap);
    }

    /* If we got here, no magic was found */