diff mbox series

[BlueZ,v1] device: Fix marking device as temporary

Message ID 20240613170313.1596181-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1] device: Fix marking device as temporary | expand

Commit Message

Luiz Augusto von Dentz June 13, 2024, 5:03 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If bonding has failed but there are other bearers connected don't mark
the device as temporary.

Fixes: https://github.com/bluez/bluez/issues/856
---
 src/device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

patchwork-bot+bluetooth@kernel.org June 14, 2024, 3 p.m. UTC | #1
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 13 Jun 2024 13:03:13 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> If bonding has failed but there are other bearers connected don't mark
> the device as temporary.
> 
> Fixes: https://github.com/bluez/bluez/issues/856
> 
> [...]

Here is the summary with links:
  - [BlueZ,v1] device: Fix marking device as temporary
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=48b7f7e5fe53

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index 5dc1cd0cdbf2..486ffdb4ea8d 100644
--- a/src/device.c
+++ b/src/device.c
@@ -6428,7 +6428,8 @@  void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type,
 		/* Put the device back to the temporary state so that it will be
 		 * treated as a newly discovered device.
 		 */
-		if (!device_is_paired(device, bdaddr_type) &&
+		if (!btd_device_bearer_is_connected(device) &&
+				!device_is_paired(device, bdaddr_type) &&
 				!btd_device_is_trusted(device))
 			btd_device_set_temporary(device, true);