Skip to content

Commit 84bc0db

Browse files
jhedbergholtmann
authored andcommitted
Bluetooth: Don't take any action in smp_resume_cb if not encrypted
When smp_resume_cb is called if we're not encrypted (i.e. the callback wasn't called because the connection became encrypted) we shouldn't take any action at all. This patch moves also the security_timer cancellation behind this condition. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 1b0921d commit 84bc0db

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎net/bluetooth/smp.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,10 +1533,12 @@ static void smp_resume_cb(struct l2cap_chan *chan)
15331533
if (!smp)
15341534
return;
15351535

1536+
if (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
1537+
return;
1538+
15361539
cancel_delayed_work(&smp->security_timer);
15371540

1538-
if (test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
1539-
queue_work(hdev->workqueue, &smp->distribute_work);
1541+
queue_work(hdev->workqueue, &smp->distribute_work);
15401542
}
15411543

15421544
static void smp_ready_cb(struct l2cap_chan *chan)

0 commit comments

Comments
 (0)