diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 8b0c8e631324..f4800ea6f19b 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -2872,7 +2872,7 @@ static int abort_conn_sync(struct hci_dev *hdev, void *data) u16 handle = PTR_UINT(data); conn = hci_conn_hash_lookup_handle(hdev, handle); - if (!conn) + if (!conn || WARN_ON(!conn->abort_reason)) return 0; return hci_abort_conn_sync(hdev, conn, conn->abort_reason); @@ -2887,6 +2887,8 @@ int hci_abort_conn(struct hci_conn *conn, u8 reason) */ if (conn->abort_reason) return 0; + if (WARN_ON(!reason)) + reason = HCI_ERROR_UNSPECIFIED; bt_dev_dbg(hdev, "handle 0x%2.2x reason 0x%2.2x", conn->handle, reason);