]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/bluetooth/mgmt.c
Bluetooth: Fix limited discoverable mode for Zeevo modules
[karo-tx-linux.git] / net / bluetooth / mgmt.c
index 074d83690a414c8e668499d7f7e7c86215c563ea..22cf54710744803506b266ab4d9af75611492ecb 100644 (file)
@@ -1264,7 +1264,7 @@ static int set_discoverable(struct sock *sk, struct hci_dev *hdev, void *data,
 
                if (cp->val == 0x02) {
                        /* Limited discoverable mode */
-                       hci_cp.num_iac = 2;
+                       hci_cp.num_iac = min_t(u8, hdev->num_iac, 2);
                        hci_cp.iac_lap[0] = 0x00;       /* LIAC */
                        hci_cp.iac_lap[1] = 0x8b;
                        hci_cp.iac_lap[2] = 0x9e;