Skip to content

Commit

Permalink
Bluetooth: Add an extra check in mgmt_device_disconnected()
Browse files Browse the repository at this point in the history
This patch adds an extra check in mgmt_device_disconnected() so we only
send the "Device Disconnected" event if it is ACL_LINK or LE_LINK link
type.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Andre Guedes authored and Gustavo Padovan committed Dec 4, 2013
1 parent 3655bba commit 57eb776
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -4595,6 +4595,9 @@ void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,
struct mgmt_ev_device_disconnected ev;
struct sock *sk = NULL;

if (link_type != ACL_LINK && link_type != LE_LINK)
return;

mgmt_pending_foreach(MGMT_OP_DISCONNECT, hdev, disconnect_rsp, &sk);

bacpy(&ev.addr.bdaddr, bdaddr);
Expand Down

0 comments on commit 57eb776

Please sign in to comment.