summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg2014-06-18 13:09:40 +0200
committerMarcel Holtmann2014-07-03 17:42:43 +0200
commitd97c9fb0c82afc6042004ed3f381d85ff31fadcc (patch)
tree08e28240b8babc63638dc9fda9ebbc252d0af1f8 /net/bluetooth/hci_core.c
parentBluetooth: Fix validating IO capability values in mgmt commands (diff)
downloadkernel-qcow2-linux-d97c9fb0c82afc6042004ed3f381d85ff31fadcc.tar.gz
kernel-qcow2-linux-d97c9fb0c82afc6042004ed3f381d85ff31fadcc.tar.xz
kernel-qcow2-linux-d97c9fb0c82afc6042004ed3f381d85ff31fadcc.zip
Bluetooth: Fix checking for master LTKs
When the rename of STK_SLAVE to simply STK happened we missed this place in the ltk_type_master function. Now, checking for master is as simple as checking whether the type is SMP_LTK. The helper function is kept around for better readability in the (right now three) callers and for simpler extension with new key types in the future. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Tested-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 6001b9293905..c3d184fd24de 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2974,10 +2974,7 @@ static bool hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn,
static bool ltk_type_master(u8 type)
{
- if (type == SMP_STK || type == SMP_LTK)
- return true;
-
- return false;
+ return (type == SMP_LTK);
}
struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand,