summaryrefslogtreecommitdiff
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-08-08 10:32:48 +0400
committerMarcel Holtmann <marcel@holtmann.org>2014-08-14 10:49:16 +0400
commitfabed38fcf456cc5d3e6946fab78855aa65bd40b (patch)
treee100fad994078208e699fd9cc50fc715a883afdc /net/bluetooth/hci_core.c
parentd3368605591b88cd8af522adadb1c460a8f8e7bb (diff)
downloadlinux-fabed38fcf456cc5d3e6946fab78855aa65bd40b.tar.xz
Bluetooth: Fix hci_update_random_address() error return for no crypto
If the AES crypto context is not available we cannot generate new RPAs. We should therefore cleanly return an error from the function responsible for updating the random address. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 217ef83fb541..860477090d78 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3882,6 +3882,12 @@ int hci_update_random_address(struct hci_request *req, bool require_privacy,
!bacmp(&hdev->random_addr, &hdev->rpa))
return 0;
+ if (!hdev->tfm_aes) {
+ BT_ERR("%s crypto not available to generate RPA",
+ hdev->name);
+ return -EOPNOTSUPP;
+ }
+
err = smp_generate_rpa(hdev->tfm_aes, hdev->irk, &hdev->rpa);
if (err < 0) {
BT_ERR("%s failed to generate new RPA", hdev->name);