2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 12:43:55 +08:00
linux-next/net/bluetooth
Marcel Holtmann ea8ae2516a Bluetooth: Fix bug with filter in service discovery optimization
The optimization for filtering out extended inquiry results, advertising
reports or scan response data based on provided UUID list has a logic
bug. In case no match is found in the advertising data, the scan
response is ignored and not checked against the filter. This will lead
to events being filtered wrongly.

Change the code to actually only drop the events when the scan response
data is not present. If it is present, it needs to be checked against
the provided filter.

The patch is a bit more complex than it needs to be. That is because
it also fixes this compiler warning that some gcc versions produce.

  CC      net/bluetooth/mgmt.o
net/bluetooth/mgmt.c: In function ‘mgmt_device_found’:
net/bluetooth/mgmt.c:7028:7: warning: ‘match’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  bool match;
       ^

It seems that gcc can not clearly figure out the context of the match
variable. So just change the branches for the extended inquiry response
and advertising data around so that it is clear.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2014-12-17 22:03:49 +02:00
..
bnep Bluetooth: Introduce BT_BREDR and BT_LE config options 2014-11-02 10:01:53 +02:00
cmtp Bluetooth: Introduce BT_BREDR and BT_LE config options 2014-11-02 10:01:53 +02:00
hidp Bluetooth: hidp: replace kzalloc/copy_from_user by memdup_user 2014-11-15 01:30:16 +01:00
rfcomm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-12-11 14:27:06 -08:00
6lowpan.c first fruits - kill l2cap ->memcpy_fromiovec() 2014-12-09 16:29:10 -05:00
a2mp.c first fruits - kill l2cap ->memcpy_fromiovec() 2014-12-09 16:29:10 -05:00
a2mp.h Bluetooth: Move a2mp.h header file into net/bluetooth/ 2013-10-11 00:10:05 +02:00
af_bluetooth.c Merge tag 'master-2014-12-08' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next 2014-12-09 18:12:03 -05:00
amp.c Bluetooth: Fix sparse warning in amp.c 2014-11-11 00:07:29 +01:00
amp.h Bluetooth: Move amp.h header file into net/bluetooth/ 2013-10-11 00:10:03 +02:00
ecc.c Bluetooth: Add ECC library for LE Secure Connections 2014-12-03 16:51:16 +01:00
ecc.h Bluetooth: Add ECC library for LE Secure Connections 2014-12-03 16:51:16 +01:00
hci_conn.c Bluetooth: Fix generation of non-resolvable private addresses 2014-12-08 09:21:14 +02:00
hci_core.c Bluetooth: Fix notifying mgmt power off before flushing connection list 2014-12-11 20:57:39 +01:00
hci_event.c Bluetooth: Fix missing hci_dev_lock/unlock in hci_event 2014-12-11 15:09:04 +01:00
hci_sock.c new helper: memcpy_from_msg() 2014-11-24 04:28:48 -05:00
hci_sysfs.c Bluetooth: Convert to use ATTRIBUTE_GROUPS macro 2014-02-13 09:51:34 +02:00
Kconfig Bluetooth: Add basic support for AES-CMAC 2014-12-03 16:51:16 +01:00
l2cap_core.c Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next 2014-12-15 13:23:09 -05:00
l2cap_sock.c first fruits - kill l2cap ->memcpy_fromiovec() 2014-12-09 16:29:10 -05:00
lib.c Bluetooth: Convert bt_<level> logging functions to return void 2014-09-24 09:40:08 +02:00
Makefile Bluetooth: Add ECC library for LE Secure Connections 2014-12-03 16:51:16 +01:00
mgmt.c Bluetooth: Fix bug with filter in service discovery optimization 2014-12-17 22:03:49 +02:00
sco.c new helper: memcpy_from_msg() 2014-11-24 04:28:48 -05:00
smp.c Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next 2014-12-15 13:23:09 -05:00
smp.h Bluetooth: Fix missing const declarations in SMP functions 2014-12-03 16:51:21 +01:00