From 13540084ad267b1ebf9d28838bcc966c96412367 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 16 Jun 2021 01:10:51 +0200 Subject: [PATCH] [Controller] Return an error during shutdown if no device layer is used and something unexpected happens during inet/system shutdown (#7605) --- src/controller/CHIPDeviceController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 51e59c92eb053a..2456fb66443b35 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -301,8 +301,8 @@ CHIP_ERROR DeviceController::Shutdown() // ReturnErrorOnFailure(DeviceLayer::PlatformMgr().Shutdown()); #else - mInetLayer->Shutdown(); - mSystemLayer->Shutdown(); + VerifyOrReturnError(mInetLayer->Shutdown() == INET_NO_ERROR, CHIP_ERROR_INTERNAL); + VerifyOrReturnError(mSystemLayer->Shutdown() == CHIP_SYSTEM_NO_ERROR, CHIP_ERROR_INTERNAL); chip::Platform::Delete(mInetLayer); chip::Platform::Delete(mSystemLayer); #endif // CONFIG_DEVICE_LAYER