Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84bc0db5 authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann
Browse files

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: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 1b0921d6
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1533,9 +1533,11 @@ static void smp_resume_cb(struct l2cap_chan *chan)
	if (!smp)
	if (!smp)
		return;
		return;


	if (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
		return;

	cancel_delayed_work(&smp->security_timer);
	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);
}
}