summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/smp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index b8ecc7b..9accb47 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1533,10 +1533,12 @@ static void smp_resume_cb(struct l2cap_chan *chan)
if (!smp)
return;
+ if (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
+ return;
+
cancel_delayed_work(&smp->security_timer);
- if (test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
- queue_work(hdev->workqueue, &smp->distribute_work);
+ queue_work(hdev->workqueue, &smp->distribute_work);
}
static void smp_ready_cb(struct l2cap_chan *chan)