Skip to content

Commit

Permalink
[ota] cancelupdate and progress state from kApplying to kIdle when Ha…
Browse files Browse the repository at this point in the history
…ndleApply fails (#26499)
  • Loading branch information
pankore authored and pull[bot] committed Feb 26, 2024
1 parent d4b2098 commit d25d925
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/platform/Ameba/AmebaOTAImageProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ void AmebaOTAImageProcessor::HandleApply(intptr_t context)
if (imageProcessor == nullptr)
{
ChipLogError(SoftwareUpdate, "ImageProcessor context is null");
GetRequestorInstance()->CancelImageUpdate();
return;
}

Expand All @@ -409,12 +410,14 @@ void AmebaOTAImageProcessor::HandleApply(intptr_t context)
{
ota_update_free(imageProcessor->pOtaTgtHdr);
ChipLogError(SoftwareUpdate, "OTA update signature failed");
GetRequestorInstance()->CancelImageUpdate();
return;
}
#elif defined(CONFIG_PLATFORM_8710C)
if (update_ota_signature(imageProcessor->signature, imageProcessor->flash_addr) < 0)
{
ChipLogError(SoftwareUpdate, "OTA update signature failed");
GetRequestorInstance()->CancelImageUpdate();
return;
}
#endif
Expand Down

0 comments on commit d25d925

Please sign in to comment.