ubus: add missing lock for ubus hearing_map

In the build_hearing_map_sort_client there was a dawn_mutex_require
without having locked the mutex resulting in warnings:

  daemon.warn dawn: MUTEX require = 4226B8@ubus.c:2003[2012069248l] - appears to be UNLOCKED!
  daemon.warn dawn: MUTEX require = 4226B8@datastorage.c:694[2012069248l] - appears to be UNLOCKED!

I guess it was a typo, because before entering the
client_array_get_client function the mutex client_array_mutex needs to
be locked and not required.

Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
Nick Hainke 2022-07-16 19:11:48 +02:00
parent 4b7db09166
commit 0689b5e4d6

View file

@ -2000,8 +2000,9 @@ int build_hearing_map_sort_client(struct blob_buf *b) {
}
// Find the client if it is actually connected somewhere...
dawn_mutex_require(&client_array_mutex);
dawn_mutex_lock(&client_array_mutex);
client* this_client = client_array_get_client(this_entry->k->client_addr);
dawn_mutex_unlock(&client_array_mutex);
// Add the probe details
char ap_mac_buf[20];