diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp b/src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp index 1a8fda8f322c24..60cc54277c36cd 100644 --- a/src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp +++ b/src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp @@ -192,7 +192,11 @@ void DefaultOTARequestorDriver::ApplyTimerHandler(System::Layer * systemLayer, v DefaultOTARequestorDriver * driver = ToDriver(appState); VerifyOrDie(driver->mImageProcessor != nullptr); - driver->mImageProcessor->Apply(); + + if (driver->mImageProcessor->Apply() != CHIP_NO_ERROR) + { + driver->mRequestor->CancelImageUpdate(); + } } void DefaultOTARequestorDriver::UpdateAvailable(const UpdateDescription & update, System::Clock::Seconds32 delay)