Bluetooth: Don't bother user space without IO capabilities
[firefly-linux-kernel-4.4.55.git] / net / bluetooth / hci_event.c
index 1ac526022ad9486e072ed7559d9e6da023f75e2b..1bd4de7e74fc197a33226e9edd3667a3e4a74f6b 100644 (file)
@@ -3752,9 +3752,11 @@ static void hci_user_confirm_request_evt(struct hci_dev *hdev,
                /* If we're not the initiators request authorization to
                 * proceed from user space (mgmt_user_confirm with
                 * confirm_hint set to 1). The exception is if neither
-                * side had MITM in which case we do auto-accept.
+                * side had MITM or if the local IO capability is
+                * NoInputNoOutput, in which case we do auto-accept
                 */
                if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) &&
+                   conn->io_capability != HCI_IO_NO_INPUT_OUTPUT &&
                    (loc_mitm || rem_mitm)) {
                        BT_DBG("Confirming auto-accept as acceptor");
                        confirm_hint = 1;