mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
Bluetooth: Check 'dev_class' in mgmt_device_found()
The mgmt_device_found event will be used to report LE devices found during discovery procedure. Since LE advertising reports events doesn't have class of device information, we need to check if 'dev_class' is not NULL before copying it. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
parent
a8f13c8cd2
commit
f8523598ee
1 changed files with 3 additions and 1 deletions
|
@ -2324,12 +2324,14 @@ int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi,
|
|||
memset(&ev, 0, sizeof(ev));
|
||||
|
||||
bacpy(&ev.bdaddr, bdaddr);
|
||||
memcpy(ev.dev_class, dev_class, sizeof(ev.dev_class));
|
||||
ev.rssi = rssi;
|
||||
|
||||
if (eir)
|
||||
memcpy(ev.eir, eir, sizeof(ev.eir));
|
||||
|
||||
if (dev_class)
|
||||
memcpy(ev.dev_class, dev_class, sizeof(ev.dev_class));
|
||||
|
||||
return mgmt_event(MGMT_EV_DEVICE_FOUND, index, &ev, sizeof(ev), NULL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue