From cff3f508973f4a2e3204b97fe9b4cd2d03ba1e67 Mon Sep 17 00:00:00 2001 From: Rohit Jadhav <69809379+jadhavrohit924@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:13:38 +0530 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Shubham Patil --- src/platform/ESP32/OTAImageProcessorImpl.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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