Message ID | 20220311211933.3285806-1-luiz.dentz@gmail.com |
---|---|
State | New |
Headers | show |
Series | Bluetooth: Fix use after free in hci_send_acl | expand |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index e56b09806f9b..6402dc00b0e1 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -5772,8 +5772,9 @@ static void hci_disconn_phylink_complete_evt(struct hci_dev *hdev, void *data, hci_dev_lock(hdev); hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); - if (hcon) { + if (hcon && hcon->type == AMP_LINK) { hcon->state = BT_CLOSED; + hci_disconn_cfm(hcon, ev->reason); hci_conn_del(hcon); }