summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-08-08 08:32:49 +0200
committerMarcel Holtmann <marcel@holtmann.org>2014-08-14 08:49:16 +0200
commit893ededeb189aa48c308116a7acd793efae5c830 (patch)
treea4ff68aae0c6d4b09e24a554bd0c1b485b5e764d /net/bluetooth
parentBluetooth: Fix hci_update_random_address() error return for no crypto (diff)
downloadlinux-893ededeb189aa48c308116a7acd793efae5c830.tar.xz
linux-893ededeb189aa48c308116a7acd793efae5c830.zip
Bluetooth: Fix IRK lookup when tfm_aes is not available
If the AES crypto has not been initialized properly we should cleanly return from the hci_find_irk_by_rpa() function. Right now this will not happen in practice, but once (in subsequent patches) SMP init is moved to after the HCI init procedure it is possible that the pointer is NULL. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 860477090d78..4a1ec259099e 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3232,6 +3232,9 @@ struct smp_irk *hci_find_irk_by_rpa(struct hci_dev *hdev, bdaddr_t *rpa)
return irk;
}
+ if (!hdev->tfm_aes)
+ return NULL;
+
list_for_each_entry(irk, &hdev->identity_resolving_keys, list) {
if (smp_irk_matches(hdev->tfm_aes, irk->val, rpa)) {
bacpy(&irk->rpa, rpa);