diff --git a/src/platform/ESP32/OTAImageProcessorImpl.cpp b/src/platform/ESP32/OTAImageProcessorImpl.cpp index c5fd84a8671273..a35ca9a274ca67 100644 --- a/src/platform/ESP32/OTAImageProcessorImpl.cpp +++ b/src/platform/ESP32/OTAImageProcessorImpl.cpp @@ -266,11 +266,7 @@ esp_err_t OTAImageProcessorImpl::DeltaOTAWriteCallback(const uint8_t * buf, size imageProcessor->chipIdVerified = true; // Write data in headerData buffer. - esp_err_t err = esp_ota_write(imageProcessor->mOTAUpdateHandle, headerData, IMG_HEADER_LEN); - if (err != ESP_OK) - { - return err; - } + return esp_ota_write(imageProcessor->mOTAUpdateHandle, headerData, IMG_HEADER_LEN); } } @@ -325,6 +321,7 @@ void OTAImageProcessorImpl::HandlePrepareDownload(intptr_t context) if (imageProcessor->mDeltaOTAUpdateHandle == NULL) { ChipLogError(SoftwareUpdate, "esp_delta_ota_init failed"); + imageProcessor->mDownloader->OnPreparedForDownload(CHIP_ERROR_INTERNAL); return; } #endif // CONFIG_ENABLE_DELTA_OTA