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

Commit a66a9585 authored by David Anderson's avatar David Anderson Committed by Android (Google) Code Review
Browse files

Merge "fastbootd: Remove an erroneous partition size check." into main

parents a0be31fb 6bf97d49
Loading
Loading
Loading
Loading
+4 −8
Original line number Original line Diff line number Diff line
@@ -185,14 +185,10 @@ int Flash(FastbootDevice* device, const std::string& partition_name) {
        return -EINVAL;
        return -EINVAL;
    }
    }
    uint64_t block_device_size = get_block_device_size(handle.fd());
    uint64_t block_device_size = get_block_device_size(handle.fd());
    if (data.size() > block_device_size) {
    if (data.size() < block_device_size &&
        LOG(ERROR) << "Cannot flash " << data.size() << " bytes to block device of size "
        (partition_name == "boot" || partition_name == "boot_a" || partition_name == "boot_b" ||
                   << block_device_size;
         partition_name == "init_boot" || partition_name == "init_boot_a" ||
        return -EOVERFLOW;
         partition_name == "init_boot_b")) {
    } else if (data.size() < block_device_size &&
               (partition_name == "boot" || partition_name == "boot_a" ||
                partition_name == "boot_b" || partition_name == "init_boot" ||
                partition_name == "init_boot_a" || partition_name == "init_boot_b")) {
        CopyAVBFooter(&data, block_device_size);
        CopyAVBFooter(&data, block_device_size);
    }
    }
    if (android::base::GetProperty("ro.system.build.type", "") != "user") {
    if (android::base::GetProperty("ro.system.build.type", "") != "user") {