From 1eab2ee07519cf678ca7246cc16b409cc83e3371 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Sun, 23 Apr 2023 19:50:31 -0400 Subject: [PATCH] Fix assert on SystemLayer().StartTimer call by aquiring the chipStack Lock before the call (#26200) --- src/platform/Linux/BLEManagerImpl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platform/Linux/BLEManagerImpl.cpp b/src/platform/Linux/BLEManagerImpl.cpp index c9ae6ae36bf771..2cc5c6a69d19c5 100644 --- a/src/platform/Linux/BLEManagerImpl.cpp +++ b/src/platform/Linux/BLEManagerImpl.cpp @@ -796,7 +796,11 @@ void BLEManagerImpl::OnDeviceScanned(BluezDevice1 * device, const chip::Ble::Chi } mBLEScanConfig.mBleScanState = BleScanState::kConnecting; + + chip::DeviceLayer::PlatformMgr().LockChipStack(); DeviceLayer::SystemLayer().StartTimer(kConnectTimeout, HandleConnectTimeout, mpEndpoint); + chip::DeviceLayer::PlatformMgr().UnlockChipStack(); + mDeviceScanner->StopScan(); ConnectDevice(device, mpEndpoint);