set: Fix not attempt to connect devices with RSI
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 3 Apr 2023 18:50:36 +0000 (11:50 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 10:41:34 +0000 (16:11 +0530)
If a device advertising with RSI is only found later after the set was
already create we shall still attempt to connect to it.

src/set.c

index 565971e..a51f0bf 100644 (file)
--- a/src/set.c
+++ b/src/set.c
@@ -316,7 +316,8 @@ struct btd_device_set *btd_set_add_device(struct btd_device *device,
        set = set_find(device, sirk);
        if (set) {
                set_add(set, device);
-               return set;
+               /* Check if there are new devices with RSI found */
+               goto done;
        }
 
        set = set_new(device, sirk, size);
@@ -328,6 +329,7 @@ struct btd_device_set *btd_set_add_device(struct btd_device *device,
 
        queue_push_tail(set_list, set);
 
+done:
        /* Attempt to add devices which have matching RSI */
        btd_adapter_for_each_device(device_get_adapter(device), foreach_device,
                                                                        set);