From: Andre Guedes Date: Wed, 31 Jul 2013 19:25:29 +0000 (-0300) Subject: Bluetooth: Fix encryption key size for peripheral role X-Git-Tag: firefly_0821_release~176^2~5117^2~20^2^2~29^2~6 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=89cbb4da0abee2f39d75f67f9fd57f7410c8b65c;p=firefly-linux-kernel-4.4.55.git Bluetooth: Fix encryption key size for peripheral role This patch fixes the connection encryption key size information when the host is playing the peripheral role. We should set conn->enc_key_ size in hci_le_ltk_request_evt, otherwise it is left uninitialized. Cc: Stable Signed-off-by: Andre Guedes Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 04967248f899..8db3e89fae35 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3561,6 +3561,8 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb) else conn->pending_sec_level = BT_SECURITY_MEDIUM; + conn->enc_key_size = ltk->enc_size; + hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp); if (ltk->type & HCI_SMP_STK) {