diff options
author | Yun-Hao Chung <howardchung@chromium.org> | 2021-11-12 12:01:49 +0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-11-15 13:06:57 -0800 |
commit | 927059ba6097147cee62a56d43c75437e26614b7 (patch) | |
tree | 359807b65eb3418eccb14aa878bf9a7d817208a1 | |
parent | 591c546c536b42bef696d027f64aa22434f8c3f0 (diff) | |
download | bluez-927059ba6097147cee62a56d43c75437e26614b7.tar.gz |
admin: fix devices not reset
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>
-rw-r--r-- | plugins/admin.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/admin.c b/plugins/admin.c index a8e7d2cd7..0787e8381 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); } |