Bluetooth: Fix hci unintended disconnect issue 87/181587/2
authorWootak Jung <wootak.jung@samsung.com>
Fri, 15 Jun 2018 02:01:59 +0000 (11:01 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 18 Jun 2018 01:14:26 +0000 (01:14 +0000)
hci connection is disconnected unintentionally because of
short timer in case link key is existing on legacy pairing mode.
Fix timer regardless of existence of link key.

Change-Id: Id66362347d89fdd3e2914a13df98e8e14e558fea
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
net/bluetooth/hci_event.c

index 8a71d54..62eb258 100644 (file)
@@ -2327,8 +2327,12 @@ static void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
                        conn->state = BT_CONFIG;
                        hci_conn_hold(conn);
 
+#ifdef CONFIG_TIZEN_WIP
+                       if (!conn->out && !hci_conn_ssp_enabled(conn))
+#else
                        if (!conn->out && !hci_conn_ssp_enabled(conn) &&
                            !hci_find_link_key(hdev, &ev->bdaddr))
+#endif
                                conn->disc_timeout = HCI_PAIRING_TIMEOUT;
                        else
                                conn->disc_timeout = HCI_DISCONN_TIMEOUT;