Bluetooth: Fix Connection persistence, SSP caching

Fix key storage when not bonding
Fix when LE ACL is disconnected after use

Signed-off-by: Brian Gix <bgix@codeaurora.org>
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 65af37f..2528c7f 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1123,8 +1123,12 @@
 
 	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, bdaddr);
 
-	if (conn && (conn->auth_type > 0x01 || conn->remote_auth > 0x01))
-		bonded = 1;
+	if (conn) {
+		if (conn->remote_auth > 0x01)
+			bonded = 1;
+		else if (conn->auth_initiator && conn->auth_type > 0x01)
+			bonded = 1;
+	}
 
 	if (new_key)
 		mgmt_new_key(hdev->id, key, bonded);