Merge remote-tracking branch 'stable/linux-4.19.y' into rpi-4.19.y
[platform/kernel/linux-rpi.git] / net / bluetooth / hci_conn.c
index f5c2706..4ab5e46 100644 (file)
@@ -1280,8 +1280,13 @@ int hci_conn_check_link_mode(struct hci_conn *conn)
                        return 0;
        }
 
-       if (hci_conn_ssp_enabled(conn) &&
-           !test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+       /* If Secure Simple Pairing is not enabled, then legacy connection
+        * setup is used and no encryption or key sizes can be enforced.
+        */
+       if (!hci_conn_ssp_enabled(conn))
+               return 1;
+
+       if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
                return 0;
 
        return 1;