diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 913cec3e52d704c567aa5ebe1d9558793800c0a7..ce93dcf0c2db9af91e33a134a374679a5153c3ce 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -4813,7 +4813,8 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) BT_DBG("conn %p", conn); if (hcon->type == LE_LINK) { - smp_distribute_keys(conn, 0); + if (!status && encrypt) + smp_distribute_keys(conn, 0); cancel_delayed_work(&conn->security_timer); }