Skip to content

Commit

Permalink
Reset the OTARequestor state if the downloaded image is invalid (#26230)
Browse files Browse the repository at this point in the history
  • Loading branch information
selissia authored and pull[bot] committed Sep 14, 2023
1 parent 34b13d2 commit 5880446
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/platform/silabs/SiWx917/OTAImageProcessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ void OTAImageProcessorImpl::HandleApply(intptr_t context)
if (err != SL_BOOTLOADER_OK)
{
ChipLogError(SoftwareUpdate, "ERROR: bootloader_verifyImage() error %ld", err);
// Call the OTARequestor API to reset the state
GetRequestorInstance()->CancelImageUpdate();

return;
}
Expand All @@ -198,6 +200,8 @@ void OTAImageProcessorImpl::HandleApply(intptr_t context)
if (err != SL_BOOTLOADER_OK)
{
ChipLogError(SoftwareUpdate, "ERROR: bootloader_setImageToBootload() error %ld", err);
// Call the OTARequestor API to reset the state
GetRequestorInstance()->CancelImageUpdate();

return;
}
Expand Down
4 changes: 4 additions & 0 deletions src/platform/silabs/efr32/OTAImageProcessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ void OTAImageProcessorImpl::HandleApply(intptr_t context)
if (err != SL_BOOTLOADER_OK)
{
ChipLogError(SoftwareUpdate, "ERROR: bootloader_verifyImage() error %ld", err);
// Call the OTARequestor API to reset the state
GetRequestorInstance()->CancelImageUpdate();

return;
}
Expand All @@ -209,6 +211,8 @@ void OTAImageProcessorImpl::HandleApply(intptr_t context)
if (err != SL_BOOTLOADER_OK)
{
ChipLogError(SoftwareUpdate, "ERROR: bootloader_setImageToBootload() error %ld", err);
// Call the OTARequestor API to reset the state
GetRequestorInstance()->CancelImageUpdate();

return;
}
Expand Down

0 comments on commit 5880446

Please sign in to comment.