From d94587937360b9c75a54613507106ad62b01a4d3 Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Fri, 3 May 2024 15:03:54 +0300 Subject: [PATCH] uORBManager.cpp: Fix issue with registerCallback A curly brace was misplaced, calls to unlock_cb_list() etc belong within the statement if (cb_lock >= 0) { } --- platforms/common/uORB/uORBManager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platforms/common/uORB/uORBManager.cpp b/platforms/common/uORB/uORBManager.cpp index 6a9327a4e481..c523ba8baee8 100644 --- a/platforms/common/uORB/uORBManager.cpp +++ b/platforms/common/uORB/uORBManager.cpp @@ -567,16 +567,16 @@ uORB::Manager::registerCallback(orb_advert_t &node_handle, SubscriptionCallback // keep the cb list locked; this prevents the callback thread from trying to access the callback item before it is registered to the device node #endif ret = uORB::DeviceNode::register_callback(node_handle, callback_sub, cb_lock, last_update, - interval_us, cb_handle); #ifndef CONFIG_BUILD_FLAT - } - if (!ret) { - per_process_cb_list.remove(callback_sub); + if (!ret) { + per_process_cb_list.remove(callback_sub); + } + + unlock_cb_list(); } - unlock_cb_list(); #endif return ret;