Fix not able to disconnect from the Host after SMP requests

The following fixes were added:
1. While using whitelist API for connection, if SMP requests are received
before the L2CAP channel is correctly setup, queue the SMP requets
and execute them once the channel state is bounded and connected and
therefore maintaining the correct connection reference count.
2. If the status LE start encryption command is not successful,
then call hci_conn put which would decrement the HCI connection
reference count.

CRs-fixed: 447092
Change-Id: Ibb11ecf94f28e0b0aff5eacc86d1660e7ec2e25d
Signed-off-by: Archana Ramachandran <archanar@codeaurora.org>
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index b908996..75a74ac 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1035,6 +1035,12 @@
 	return 0;
 }
 
+void smp_conn_security_fail(struct l2cap_conn *conn, u8 code, u8 reason)
+{
+	BT_DBG("smp: %d %d ", code, reason);
+	smp_send_cmd(conn, SMP_CMD_PAIRING_FAIL, sizeof(reason), &reason);
+}
+
 int smp_link_encrypt_cmplt(struct l2cap_conn *conn, u8 status, u8 encrypt)
 {
 	struct hci_conn *hcon = conn->hcon;