From: Johan Hedberg Date: Thu, 28 Apr 2011 18:28:58 +0000 (-0700) Subject: Bluetooth: Fix logic in hci_pin_code_request_evt X-Git-Tag: firefly_0821_release~7613^2~967^2~16^2~94^2~14 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=582fbe9ef9d6fc089ff20956595f046d4899e74e;p=firefly-linux-kernel-4.4.55.git Bluetooth: Fix logic in hci_pin_code_request_evt The mgmt_ev_pin_code_request event should not be sent to user space if the request gets rejected by the kernel due to the pairable flag not being set. Signed-off-by: Johan Hedberg Signed-off-by: Gustavo F. Padovan --- diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index d535ea4ccbed..ebbaa6c8d015 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -2035,8 +2035,7 @@ static inline void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff if (!test_bit(HCI_PAIRABLE, &hdev->flags)) hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY, sizeof(ev->bdaddr), &ev->bdaddr); - - if (test_bit(HCI_MGMT, &hdev->flags)) { + else if (test_bit(HCI_MGMT, &hdev->flags)) { u8 secure; if (conn->pending_sec_level == BT_SECURITY_HIGH)