From 02c1d6b8bce3d8f1994764691bf0a0db527c6001 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 14 Jun 2021 18:00:40 +0200 Subject: [PATCH] [Controller] Return an error during shutdown if no device layer is used and something unexpected happens during inet/system shutdown --- 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 356b5bace489ba..b14c75d86670ae 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