浏览代码

Bluetooth: Make LTK key type check more readable

Instead of magic bitwise operations simply compare with the two possible
type values that we are interested in.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg 11 年之前
父节点
当前提交
21b93b75ad
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/bluetooth/hci_core.c

+ 1 - 1
net/bluetooth/hci_core.c

@@ -2717,7 +2717,7 @@ int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type,
 	if (!new_key)
 	if (!new_key)
 		return 0;
 		return 0;
 
 
-	if (type & HCI_SMP_LTK)
+	if (type == HCI_SMP_LTK || type == HCI_SMP_LTK_SLAVE)
 		mgmt_new_ltk(hdev, key, 1);
 		mgmt_new_ltk(hdev, key, 1);
 
 
 	return 0;
 	return 0;