Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59589d47 authored by Daniel Zheng's avatar Daniel Zheng
Browse files

Asserting flashing plan is used in do_flash

Adding check to ensure flashing plan is used in do_flash. FlashingPlan
should never be null

Test: fastboot flashall -w
Change-Id: I8e69326c59b31c7b54d6d2e04c8ce5c0f12693a7
parent a0d2401d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1489,10 +1489,13 @@ static std::string repack_ramdisk(const char* pname, struct fastboot_buffer* buf

void do_flash(const char* pname, const char* fname, const bool apply_vbmeta,
              const FlashingPlan* fp) {
    if (!fp) {
        die("do flash was called without a valid flashing plan");
    }
    verbose("Do flash %s %s", pname, fname);
    struct fastboot_buffer buf;

    if (fp && fp->source) {
    if (fp->source) {
        unique_fd fd = fp->source->OpenFile(fname);
        if (fd < 0 || !load_buf_fd(std::move(fd), &buf, fp)) {
            die("could not load '%s': %s", fname, strerror(errno));