[PATCH 3/3] adapter: Fix checking if LE device is discoverable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kernel is not adding flags field to EIR if none of flags is set.
---
 src/adapter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index ac756c1..ee3358d 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -4300,8 +4300,8 @@ static void update_found_devices(struct btd_adapter *adapter,
 
 	/* Avoid creating LE device if it's not discoverable */
 	if (bdaddr_type != BDADDR_BREDR &&
-			!(eir_data.flags &
-				(EIR_FLAG_LIM_DISC | EIR_FLAG_GEN_DISC))) {
+				(eir_data.flags < 0 || !(eir_data.flags &
+				(EIR_FLAG_LIM_DISC | EIR_FLAG_GEN_DISC)))) {
 		eir_data_free(&eir_data);
 		return;
 	}
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux