aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-02-03 17:06:00 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-13 10:01:35 -0500
commit053c7e0c4a40e2bb44e3c1e61e263be00688a136 (patch)
tree11017e93d2bd532e745e53b240769a9b0f235b59 /net/bluetooth/mgmt.c
parente87775250f322b8f1612cf9918fcde827948f087 (diff)
Bluetooth: Fix device_found event length for remote name resolving
The correct length of the event is the size of the ev struct (not size of the pointer like the code was previously using) plus the length of the variable-sized EIR data at the end of the struct. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index de7326b111ba..11ee5db16e97 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2964,7 +2964,8 @@ int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
2964 2964
2965 put_unaligned_le16(eir_len, &ev->eir_len); 2965 put_unaligned_le16(eir_len, &ev->eir_len);
2966 2966
2967 return mgmt_event(MGMT_EV_DEVICE_FOUND, hdev, &ev, sizeof(ev), NULL); 2967 return mgmt_event(MGMT_EV_DEVICE_FOUND, hdev, ev,
2968 sizeof(*ev) + eir_len, NULL);
2968} 2969}
2969 2970
2970int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status) 2971int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status)