2021-09-06 06:07:03

by Yun-hao Chung

[permalink] [raw]
Subject: [Bluez PATCH v2 1/2] plugins/admin: add adapter_remove handler

From: Yun-Hao Chung <[email protected]>

Currently admin doesn't handle adapter removed callbacks, which causes
interfaces AdminPolicySet1 and AdminPolicyStatus1 not being
unregistered, which in turns causes these interfaces can not be
re-registered once adapter is back.

This adds handler for adapter_remove.

Reviewed-by: Shyh-In Hwang <[email protected]>
Reviewed-by: Miao-chen Chou <[email protected]>
---
tested with following steps
1. rmmod btusb
2. modprobe btusb
3. read allowlist via bluetoothctl

Changes in v2:
1. Fix make errors

plugins/admin.c | 35 ++++++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/plugins/admin.c b/plugins/admin.c
index 02fec04568ba..82c00cabdb6b 100644
--- a/plugins/admin.c
+++ b/plugins/admin.c
@@ -85,6 +85,17 @@ static void admin_policy_free(void *data)
g_free(admin_policy);
}

+static void admin_policy_destroy(struct btd_admin_policy *admin_policy)
+{
+ const char *path = adapter_get_path(admin_policy->adapter);
+
+ g_dbus_unregister_interface(dbus_conn, path,
+ ADMIN_POLICY_SET_INTERFACE);
+ g_dbus_unregister_interface(dbus_conn, path,
+ ADMIN_POLICY_STATUS_INTERFACE);
+ admin_policy_free(admin_policy);
+}
+
static bool uuid_match(const void *data, const void *match_data)
{
const bt_uuid_t *uuid = data;
@@ -492,7 +503,7 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
if (!g_dbus_register_interface(dbus_conn, adapter_path,
ADMIN_POLICY_SET_INTERFACE,
admin_policy_adapter_methods, NULL,
- NULL, policy_data, admin_policy_free)) {
+ NULL, policy_data, NULL)) {
btd_error(policy_data->adapter_id,
"Admin Policy Set interface init failed on path %s",
adapter_path);
@@ -506,7 +517,7 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
ADMIN_POLICY_STATUS_INTERFACE,
NULL, NULL,
admin_policy_adapter_properties,
- policy_data, admin_policy_free)) {
+ policy_data, NULL)) {
btd_error(policy_data->adapter_id,
"Admin Policy Status interface init failed on path %s",
adapter_path);
@@ -574,10 +585,24 @@ static void admin_policy_device_removed(struct btd_adapter *adapter,
unregister_device_data(data, NULL);
}

+static void admin_policy_remove(struct btd_adapter *adapter)
+{
+ DBG("");
+
+ queue_foreach(devices, unregister_device_data, NULL);
+ queue_destroy(devices, g_free);
+
+ if (policy_data) {
+ admin_policy_destroy(policy_data);
+ policy_data = NULL;
+ }
+}
+
static struct btd_adapter_driver admin_policy_driver = {
.name = "admin_policy",
.probe = admin_policy_adapter_probe,
.resume = NULL,
+ .remove = admin_policy_remove,
.device_resolved = admin_policy_device_added,
.device_removed = admin_policy_device_removed
};
@@ -597,11 +622,7 @@ static void admin_exit(void)
DBG("");

btd_unregister_adapter_driver(&admin_policy_driver);
- queue_foreach(devices, unregister_device_data, NULL);
- queue_destroy(devices, g_free);
-
- if (policy_data)
- admin_policy_free(policy_data);
+ admin_policy_remove(NULL);
}

BLUETOOTH_PLUGIN_DEFINE(admin, VERSION,
--
2.33.0.153.gba50c8fa24-goog


2021-09-06 06:07:03

by Yun-hao Chung

[permalink] [raw]
Subject: [Bluez PATCH v2 2/2] plugins/admin: create admin_policy_settings if not exists

From: Yun-Hao Chung <[email protected]>

If admin_policy_settings is not found when loading, we should create one
instead of printing error.

Reviewed-by: Shyh-In Hwang <[email protected]>
Reviewed-by: Miao-chen Chou <[email protected]>
---
This patch has been tested with following steps:
rm /var/lib/bluetooth/admin_policy_settings and restart bluetoothd.
Check if the file is created.

(no changes since v1)

plugins/admin.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/plugins/admin.c b/plugins/admin.c
index 82c00cabdb6b..8390f3c32bbd 100644
--- a/plugins/admin.c
+++ b/plugins/admin.c
@@ -67,7 +67,7 @@ static struct btd_admin_policy *admin_policy_new(struct btd_adapter *adapter)

admin_policy->adapter = adapter;
admin_policy->adapter_id = btd_adapter_get_index(adapter);
- admin_policy->service_allowlist = NULL;
+ admin_policy->service_allowlist = queue_new();

return admin_policy;
}
@@ -335,12 +335,8 @@ static void load_policy_settings(struct btd_admin_policy *admin_policy)
char *filename = ADMIN_POLICY_STORAGE;
struct stat st;

- if (stat(filename, &st) < 0) {
- btd_error(admin_policy->adapter_id,
- "Failed to get file %s information",
- filename);
- return;
- }
+ if (stat(filename, &st) < 0)
+ store_policy_settings(policy_data);

key_file = g_key_file_new();

--
2.33.0.153.gba50c8fa24-goog

2021-09-15 12:34:03

by Yun-hao Chung

[permalink] [raw]
Subject: Re: [Bluez PATCH v2 1/2] plugins/admin: add adapter_remove handler

Gentle ping. Thanks.


On Mon, Sep 6, 2021 at 2:03 PM Howard Chung <[email protected]> wrote:
>
> From: Yun-Hao Chung <[email protected]>
>
> Currently admin doesn't handle adapter removed callbacks, which causes
> interfaces AdminPolicySet1 and AdminPolicyStatus1 not being
> unregistered, which in turns causes these interfaces can not be
> re-registered once adapter is back.
>
> This adds handler for adapter_remove.
>
> Reviewed-by: Shyh-In Hwang <[email protected]>
> Reviewed-by: Miao-chen Chou <[email protected]>
> ---
> tested with following steps
> 1. rmmod btusb
> 2. modprobe btusb
> 3. read allowlist via bluetoothctl
>
> Changes in v2:
> 1. Fix make errors
>
> plugins/admin.c | 35 ++++++++++++++++++++++++++++-------
> 1 file changed, 28 insertions(+), 7 deletions(-)
>
> diff --git a/plugins/admin.c b/plugins/admin.c
> index 02fec04568ba..82c00cabdb6b 100644
> --- a/plugins/admin.c
> +++ b/plugins/admin.c
> @@ -85,6 +85,17 @@ static void admin_policy_free(void *data)
> g_free(admin_policy);
> }
>
> +static void admin_policy_destroy(struct btd_admin_policy *admin_policy)
> +{
> + const char *path = adapter_get_path(admin_policy->adapter);
> +
> + g_dbus_unregister_interface(dbus_conn, path,
> + ADMIN_POLICY_SET_INTERFACE);
> + g_dbus_unregister_interface(dbus_conn, path,
> + ADMIN_POLICY_STATUS_INTERFACE);
> + admin_policy_free(admin_policy);
> +}
> +
> static bool uuid_match(const void *data, const void *match_data)
> {
> const bt_uuid_t *uuid = data;
> @@ -492,7 +503,7 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
> if (!g_dbus_register_interface(dbus_conn, adapter_path,
> ADMIN_POLICY_SET_INTERFACE,
> admin_policy_adapter_methods, NULL,
> - NULL, policy_data, admin_policy_free)) {
> + NULL, policy_data, NULL)) {
> btd_error(policy_data->adapter_id,
> "Admin Policy Set interface init failed on path %s",
> adapter_path);
> @@ -506,7 +517,7 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
> ADMIN_POLICY_STATUS_INTERFACE,
> NULL, NULL,
> admin_policy_adapter_properties,
> - policy_data, admin_policy_free)) {
> + policy_data, NULL)) {
> btd_error(policy_data->adapter_id,
> "Admin Policy Status interface init failed on path %s",
> adapter_path);
> @@ -574,10 +585,24 @@ static void admin_policy_device_removed(struct btd_adapter *adapter,
> unregister_device_data(data, NULL);
> }
>
> +static void admin_policy_remove(struct btd_adapter *adapter)
> +{
> + DBG("");
> +
> + queue_foreach(devices, unregister_device_data, NULL);
> + queue_destroy(devices, g_free);
> +
> + if (policy_data) {
> + admin_policy_destroy(policy_data);
> + policy_data = NULL;
> + }
> +}
> +
> static struct btd_adapter_driver admin_policy_driver = {
> .name = "admin_policy",
> .probe = admin_policy_adapter_probe,
> .resume = NULL,
> + .remove = admin_policy_remove,
> .device_resolved = admin_policy_device_added,
> .device_removed = admin_policy_device_removed
> };
> @@ -597,11 +622,7 @@ static void admin_exit(void)
> DBG("");
>
> btd_unregister_adapter_driver(&admin_policy_driver);
> - queue_foreach(devices, unregister_device_data, NULL);
> - queue_destroy(devices, g_free);
> -
> - if (policy_data)
> - admin_policy_free(policy_data);
> + admin_policy_remove(NULL);
> }
>
> BLUETOOTH_PLUGIN_DEFINE(admin, VERSION,
> --
> 2.33.0.153.gba50c8fa24-goog
>

2021-09-15 23:41:01

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [Bluez PATCH v2 1/2] plugins/admin: add adapter_remove handler

Hi Howard,

On Wed, Sep 15, 2021 at 5:32 AM Yun-hao Chung <[email protected]> wrote:
>
> Gentle ping. Thanks.
>
>
> On Mon, Sep 6, 2021 at 2:03 PM Howard Chung <[email protected]> wrote:
> >
> > From: Yun-Hao Chung <[email protected]>
> >
> > Currently admin doesn't handle adapter removed callbacks, which causes
> > interfaces AdminPolicySet1 and AdminPolicyStatus1 not being
> > unregistered, which in turns causes these interfaces can not be
> > re-registered once adapter is back.
> >
> > This adds handler for adapter_remove.
> >
> > Reviewed-by: Shyh-In Hwang <[email protected]>
> > Reviewed-by: Miao-chen Chou <[email protected]>
> > ---
> > tested with following steps
> > 1. rmmod btusb
> > 2. modprobe btusb
> > 3. read allowlist via bluetoothctl
> >
> > Changes in v2:
> > 1. Fix make errors
> >
> > plugins/admin.c | 35 ++++++++++++++++++++++++++++-------
> > 1 file changed, 28 insertions(+), 7 deletions(-)
> >
> > diff --git a/plugins/admin.c b/plugins/admin.c
> > index 02fec04568ba..82c00cabdb6b 100644
> > --- a/plugins/admin.c
> > +++ b/plugins/admin.c
> > @@ -85,6 +85,17 @@ static void admin_policy_free(void *data)
> > g_free(admin_policy);
> > }
> >
> > +static void admin_policy_destroy(struct btd_admin_policy *admin_policy)
> > +{
> > + const char *path = adapter_get_path(admin_policy->adapter);
> > +
> > + g_dbus_unregister_interface(dbus_conn, path,
> > + ADMIN_POLICY_SET_INTERFACE);
> > + g_dbus_unregister_interface(dbus_conn, path,
> > + ADMIN_POLICY_STATUS_INTERFACE);
> > + admin_policy_free(admin_policy);
> > +}
> > +
> > static bool uuid_match(const void *data, const void *match_data)
> > {
> > const bt_uuid_t *uuid = data;
> > @@ -492,7 +503,7 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
> > if (!g_dbus_register_interface(dbus_conn, adapter_path,
> > ADMIN_POLICY_SET_INTERFACE,
> > admin_policy_adapter_methods, NULL,
> > - NULL, policy_data, admin_policy_free)) {
> > + NULL, policy_data, NULL)) {
> > btd_error(policy_data->adapter_id,
> > "Admin Policy Set interface init failed on path %s",
> > adapter_path);
> > @@ -506,7 +517,7 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
> > ADMIN_POLICY_STATUS_INTERFACE,
> > NULL, NULL,
> > admin_policy_adapter_properties,
> > - policy_data, admin_policy_free)) {
> > + policy_data, NULL)) {
> > btd_error(policy_data->adapter_id,
> > "Admin Policy Status interface init failed on path %s",
> > adapter_path);
> > @@ -574,10 +585,24 @@ static void admin_policy_device_removed(struct btd_adapter *adapter,
> > unregister_device_data(data, NULL);
> > }
> >
> > +static void admin_policy_remove(struct btd_adapter *adapter)
> > +{
> > + DBG("");
> > +
> > + queue_foreach(devices, unregister_device_data, NULL);
> > + queue_destroy(devices, g_free);
> > +
> > + if (policy_data) {
> > + admin_policy_destroy(policy_data);
> > + policy_data = NULL;
> > + }
> > +}
> > +
> > static struct btd_adapter_driver admin_policy_driver = {
> > .name = "admin_policy",
> > .probe = admin_policy_adapter_probe,
> > .resume = NULL,
> > + .remove = admin_policy_remove,
> > .device_resolved = admin_policy_device_added,
> > .device_removed = admin_policy_device_removed
> > };
> > @@ -597,11 +622,7 @@ static void admin_exit(void)
> > DBG("");
> >
> > btd_unregister_adapter_driver(&admin_policy_driver);
> > - queue_foreach(devices, unregister_device_data, NULL);
> > - queue_destroy(devices, g_free);
> > -
> > - if (policy_data)
> > - admin_policy_free(policy_data);
> > + admin_policy_remove(NULL);
> > }
> >
> > BLUETOOTH_PLUGIN_DEFINE(admin, VERSION,
> > --
> > 2.33.0.153.gba50c8fa24-goog
> >

Applied, thanks.


--
Luiz Augusto von Dentz

2021-09-17 10:48:13

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [Bluez PATCH v2 1/2] plugins/admin: add adapter_remove handler

Hi Howard,

On Wed, Sep 15, 2021 at 4:40 PM Luiz Augusto von Dentz
<[email protected]> wrote:
>
> Hi Howard,
>
> On Wed, Sep 15, 2021 at 5:32 AM Yun-hao Chung <[email protected]> wrote:
> >
> > Gentle ping. Thanks.
> >
> >
> > On Mon, Sep 6, 2021 at 2:03 PM Howard Chung <[email protected]> wrote:
> > >
> > > From: Yun-Hao Chung <[email protected]>
> > >
> > > Currently admin doesn't handle adapter removed callbacks, which causes
> > > interfaces AdminPolicySet1 and AdminPolicyStatus1 not being
> > > unregistered, which in turns causes these interfaces can not be
> > > re-registered once adapter is back.
> > >
> > > This adds handler for adapter_remove.
> > >
> > > Reviewed-by: Shyh-In Hwang <[email protected]>
> > > Reviewed-by: Miao-chen Chou <[email protected]>
> > > ---
> > > tested with following steps
> > > 1. rmmod btusb
> > > 2. modprobe btusb
> > > 3. read allowlist via bluetoothctl
> > >
> > > Changes in v2:
> > > 1. Fix make errors
> > >
> > > plugins/admin.c | 35 ++++++++++++++++++++++++++++-------
> > > 1 file changed, 28 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/plugins/admin.c b/plugins/admin.c
> > > index 02fec04568ba..82c00cabdb6b 100644
> > > --- a/plugins/admin.c
> > > +++ b/plugins/admin.c
> > > @@ -85,6 +85,17 @@ static void admin_policy_free(void *data)
> > > g_free(admin_policy);
> > > }
> > >
> > > +static void admin_policy_destroy(struct btd_admin_policy *admin_policy)
> > > +{
> > > + const char *path = adapter_get_path(admin_policy->adapter);
> > > +
> > > + g_dbus_unregister_interface(dbus_conn, path,
> > > + ADMIN_POLICY_SET_INTERFACE);
> > > + g_dbus_unregister_interface(dbus_conn, path,
> > > + ADMIN_POLICY_STATUS_INTERFACE);
> > > + admin_policy_free(admin_policy);
> > > +}
> > > +
> > > static bool uuid_match(const void *data, const void *match_data)
> > > {
> > > const bt_uuid_t *uuid = data;
> > > @@ -492,7 +503,7 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
> > > if (!g_dbus_register_interface(dbus_conn, adapter_path,
> > > ADMIN_POLICY_SET_INTERFACE,
> > > admin_policy_adapter_methods, NULL,
> > > - NULL, policy_data, admin_policy_free)) {
> > > + NULL, policy_data, NULL)) {
> > > btd_error(policy_data->adapter_id,
> > > "Admin Policy Set interface init failed on path %s",
> > > adapter_path);
> > > @@ -506,7 +517,7 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
> > > ADMIN_POLICY_STATUS_INTERFACE,
> > > NULL, NULL,
> > > admin_policy_adapter_properties,
> > > - policy_data, admin_policy_free)) {
> > > + policy_data, NULL)) {
> > > btd_error(policy_data->adapter_id,
> > > "Admin Policy Status interface init failed on path %s",
> > > adapter_path);
> > > @@ -574,10 +585,24 @@ static void admin_policy_device_removed(struct btd_adapter *adapter,
> > > unregister_device_data(data, NULL);
> > > }
> > >
> > > +static void admin_policy_remove(struct btd_adapter *adapter)
> > > +{
> > > + DBG("");
> > > +
> > > + queue_foreach(devices, unregister_device_data, NULL);
> > > + queue_destroy(devices, g_free);
> > > +
> > > + if (policy_data) {
> > > + admin_policy_destroy(policy_data);
> > > + policy_data = NULL;
> > > + }
> > > +}
> > > +
> > > static struct btd_adapter_driver admin_policy_driver = {
> > > .name = "admin_policy",
> > > .probe = admin_policy_adapter_probe,
> > > .resume = NULL,
> > > + .remove = admin_policy_remove,
> > > .device_resolved = admin_policy_device_added,
> > > .device_removed = admin_policy_device_removed
> > > };
> > > @@ -597,11 +622,7 @@ static void admin_exit(void)
> > > DBG("");
> > >
> > > btd_unregister_adapter_driver(&admin_policy_driver);
> > > - queue_foreach(devices, unregister_device_data, NULL);
> > > - queue_destroy(devices, g_free);
> > > -
> > > - if (policy_data)
> > > - admin_policy_free(policy_data);
> > > + admin_policy_remove(NULL);
> > > }
> > >
> > > BLUETOOTH_PLUGIN_DEFINE(admin, VERSION,
> > > --
> > > 2.33.0.153.gba50c8fa24-goog
> > >
>
> Applied, thanks.
>
>
> --

There are actually some problems with these admin plugin:

https://patchwork.kernel.org/project/bluetooth/patch/[email protected]/
https://patchwork.kernel.org/project/bluetooth/patch/[email protected]/

There is also some assumption that there could be only one
policy_data, when in fact there could be multiple btd_adapter in the
system so having admin plugin in a system with multiple adapters might
lead to various problems.


--
Luiz Augusto von Dentz

2021-09-17 15:59:45

by Yun-hao Chung

[permalink] [raw]
Subject: Re: [Bluez PATCH v2 1/2] plugins/admin: add adapter_remove handler

Thanks for catching and delivering the fixes.

I didn't consider the multiple adapters case, and I will send out
another patch to fix it.

On Fri, Sep 17, 2021 at 7:50 AM Luiz Augusto von Dentz
<[email protected]> wrote:
>
> Hi Howard,
>
> On Wed, Sep 15, 2021 at 4:40 PM Luiz Augusto von Dentz
> <[email protected]> wrote:
> >
> > Hi Howard,
> >
> > On Wed, Sep 15, 2021 at 5:32 AM Yun-hao Chung <[email protected]> wrote:
> > >
> > > Gentle ping. Thanks.
> > >
> > >
> > > On Mon, Sep 6, 2021 at 2:03 PM Howard Chung <[email protected]> wrote:
> > > >
> > > > From: Yun-Hao Chung <[email protected]>
> > > >
> > > > Currently admin doesn't handle adapter removed callbacks, which causes
> > > > interfaces AdminPolicySet1 and AdminPolicyStatus1 not being
> > > > unregistered, which in turns causes these interfaces can not be
> > > > re-registered once adapter is back.
> > > >
> > > > This adds handler for adapter_remove.
> > > >
> > > > Reviewed-by: Shyh-In Hwang <[email protected]>
> > > > Reviewed-by: Miao-chen Chou <[email protected]>
> > > > ---
> > > > tested with following steps
> > > > 1. rmmod btusb
> > > > 2. modprobe btusb
> > > > 3. read allowlist via bluetoothctl
> > > >
> > > > Changes in v2:
> > > > 1. Fix make errors
> > > >
> > > > plugins/admin.c | 35 ++++++++++++++++++++++++++++-------
> > > > 1 file changed, 28 insertions(+), 7 deletions(-)
> > > >
> > > > diff --git a/plugins/admin.c b/plugins/admin.c
> > > > index 02fec04568ba..82c00cabdb6b 100644
> > > > --- a/plugins/admin.c
> > > > +++ b/plugins/admin.c
> > > > @@ -85,6 +85,17 @@ static void admin_policy_free(void *data)
> > > > g_free(admin_policy);
> > > > }
> > > >
> > > > +static void admin_policy_destroy(struct btd_admin_policy *admin_policy)
> > > > +{
> > > > + const char *path = adapter_get_path(admin_policy->adapter);
> > > > +
> > > > + g_dbus_unregister_interface(dbus_conn, path,
> > > > + ADMIN_POLICY_SET_INTERFACE);
> > > > + g_dbus_unregister_interface(dbus_conn, path,
> > > > + ADMIN_POLICY_STATUS_INTERFACE);
> > > > + admin_policy_free(admin_policy);
> > > > +}
> > > > +
> > > > static bool uuid_match(const void *data, const void *match_data)
> > > > {
> > > > const bt_uuid_t *uuid = data;
> > > > @@ -492,7 +503,7 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
> > > > if (!g_dbus_register_interface(dbus_conn, adapter_path,
> > > > ADMIN_POLICY_SET_INTERFACE,
> > > > admin_policy_adapter_methods, NULL,
> > > > - NULL, policy_data, admin_policy_free)) {
> > > > + NULL, policy_data, NULL)) {
> > > > btd_error(policy_data->adapter_id,
> > > > "Admin Policy Set interface init failed on path %s",
> > > > adapter_path);
> > > > @@ -506,7 +517,7 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
> > > > ADMIN_POLICY_STATUS_INTERFACE,
> > > > NULL, NULL,
> > > > admin_policy_adapter_properties,
> > > > - policy_data, admin_policy_free)) {
> > > > + policy_data, NULL)) {
> > > > btd_error(policy_data->adapter_id,
> > > > "Admin Policy Status interface init failed on path %s",
> > > > adapter_path);
> > > > @@ -574,10 +585,24 @@ static void admin_policy_device_removed(struct btd_adapter *adapter,
> > > > unregister_device_data(data, NULL);
> > > > }
> > > >
> > > > +static void admin_policy_remove(struct btd_adapter *adapter)
> > > > +{
> > > > + DBG("");
> > > > +
> > > > + queue_foreach(devices, unregister_device_data, NULL);
> > > > + queue_destroy(devices, g_free);
> > > > +
> > > > + if (policy_data) {
> > > > + admin_policy_destroy(policy_data);
> > > > + policy_data = NULL;
> > > > + }
> > > > +}
> > > > +
> > > > static struct btd_adapter_driver admin_policy_driver = {
> > > > .name = "admin_policy",
> > > > .probe = admin_policy_adapter_probe,
> > > > .resume = NULL,
> > > > + .remove = admin_policy_remove,
> > > > .device_resolved = admin_policy_device_added,
> > > > .device_removed = admin_policy_device_removed
> > > > };
> > > > @@ -597,11 +622,7 @@ static void admin_exit(void)
> > > > DBG("");
> > > >
> > > > btd_unregister_adapter_driver(&admin_policy_driver);
> > > > - queue_foreach(devices, unregister_device_data, NULL);
> > > > - queue_destroy(devices, g_free);
> > > > -
> > > > - if (policy_data)
> > > > - admin_policy_free(policy_data);
> > > > + admin_policy_remove(NULL);
> > > > }
> > > >
> > > > BLUETOOTH_PLUGIN_DEFINE(admin, VERSION,
> > > > --
> > > > 2.33.0.153.gba50c8fa24-goog
> > > >
> >
> > Applied, thanks.
> >
> >
> > --
>
> There are actually some problems with these admin plugin:
>
> https://patchwork.kernel.org/project/bluetooth/patch/[email protected]/
> https://patchwork.kernel.org/project/bluetooth/patch/[email protected]/
>
> There is also some assumption that there could be only one
> policy_data, when in fact there could be multiple btd_adapter in the
> system so having admin plugin in a system with multiple adapters might
> lead to various problems.
>
>
> --
> Luiz Augusto von Dentz