diff mbox series

[Bluez,v1] admin: fix devices not reset

Message ID 20211112120136.Bluez.v1.1.Ie043f3613eba798be6f87213a6737c447634a71f@changeid (mailing list archive)
State Accepted
Delegated to: Luiz Von Dentz
Headers show
Series [Bluez,v1] admin: fix devices not reset | expand

Checks

Context Check Description
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/setupell success Setup ELL PASS
tedd_an/buildprep success Build Prep PASS
tedd_an/build success Build Configuration PASS
tedd_an/makecheck success Make Check PASS
tedd_an/makedistcheck success Make Distcheck PASS
tedd_an/build_extell success Build External ELL PASS
tedd_an/build_extell_make success Build Make with External ELL PASS

Commit Message

Howard Chung Nov. 12, 2021, 4:01 a.m. UTC
From: Yun-Hao Chung <howardchung@chromium.org>

When |admin_policy_remove| is called, we set |devices| to NULL but never
set it back until |admin_init|. This makes admin lost track of current
registered device interface, so the next |admin_policy_removed| will not
be able to unregister those interfaces.

Reviewed-by: Archie Pusaka <apusaka@chromium.org>
---
tested with the following commands
0. device X is paired
1. rmmod btusb
2. modprobe btusb
3. [bluetoothctl] remove device X
Verify |remove_device_data| is called by looking log.

 plugins/admin.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com Nov. 12, 2021, 4:46 a.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=579057

---Test result---

Test Summary:
CheckPatch                    PASS      1.34 seconds
GitLint                       PASS      0.90 seconds
Prep - Setup ELL              PASS      51.31 seconds
Build - Prep                  PASS      0.50 seconds
Build - Configure             PASS      9.51 seconds
Build - Make                  PASS      222.93 seconds
Make Check                    PASS      10.10 seconds
Make Distcheck                PASS      262.72 seconds
Build w/ext ELL - Configure   PASS      9.64 seconds
Build w/ext ELL - Make        PASS      212.15 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/plugins/admin.c b/plugins/admin.c
index a8e7d2cd7898..0787e8381ed7 100644
--- a/plugins/admin.c
+++ b/plugins/admin.c
@@ -496,6 +496,9 @@  static int admin_policy_adapter_probe(struct btd_adapter *adapter)
 {
 	const char *adapter_path;
 
+	if (!devices)
+		devices = queue_new();
+
 	if (policy_data) {
 		btd_warn(policy_data->adapter_id,
 						"Policy data already exists");
@@ -623,7 +626,6 @@  static int admin_init(void)
 	DBG("");
 
 	dbus_conn = btd_get_dbus_connection();
-	devices = queue_new();
 
 	return btd_register_adapter_driver(&admin_policy_driver);
 }