2020-08-21 06:26:01

by Sonny Sasaka

[permalink] [raw]
Subject: [PATCH BlueZ] device: unset disconnecting flag when connection is removed

From: Joseph Hwang <[email protected]>

A disconnecting flag has been used to avoid race condition
between the service browsing thread and the disconnecting
thread. We need to unset the flag when connection is removed.

---
src/device.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/device.c b/src/device.c
index 7b7808405..5ab591dd4 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3041,6 +3041,9 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type)
"Paired");
}

+ if (device)
+ set_client_diconnecting(device->client, false);
+
if (device->bredr_state.connected || device->le_state.connected)
return;

--
2.26.2


2020-08-21 07:12:46

by Sonny Sasaka

[permalink] [raw]
Subject: Re: [PATCH BlueZ] device: unset disconnecting flag when connection is removed

Dear Maintainers,

Please ignore this patch as it is broken. Apologize for the mistake.


On Thu, Aug 20, 2020 at 11:25 PM Sonny Sasaka <[email protected]> wrote:
>
> From: Joseph Hwang <[email protected]>
>
> A disconnecting flag has been used to avoid race condition
> between the service browsing thread and the disconnecting
> thread. We need to unset the flag when connection is removed.
>
> ---
> src/device.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/device.c b/src/device.c
> index 7b7808405..5ab591dd4 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -3041,6 +3041,9 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type)
> "Paired");
> }
>
> + if (device)
> + set_client_diconnecting(device->client, false);
> +
> if (device->bredr_state.connected || device->le_state.connected)
> return;
>
> --
> 2.26.2
>