Skip to content

Commit 73b2652

Browse files
GustavoARSilvaVudentz
authored andcommitted
Bluetooth: hci_sync: Use cmd->num_cis instead of magic number
At the moment of the check, `cmd->num_cis` holds the value of 0x1f, which is the max number of elements in the `cmd->cis[]` array at declaration, which is 0x1f. So, avoid using 0x1f directly, and instead use `cmd->num_cis`. Similarly to this other patch[1]. Link: https://lore.kernel.org/linux-hardening/ZivaHUQyDDK9fXEk@neat/ [1] Signed-off-by: Gustavo A. R. Silva <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent d6bb878 commit 73b2652

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/bluetooth/hci_sync.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6556,7 +6556,7 @@ int hci_le_create_cis_sync(struct hci_dev *hdev)
65566556
cis->cis_handle = cpu_to_le16(conn->handle);
65576557
aux_num_cis++;
65586558

6559-
if (aux_num_cis >= 0x1f)
6559+
if (aux_num_cis >= cmd->num_cis)
65606560
break;
65616561
}
65626562
cmd->num_cis = aux_num_cis;

0 commit comments

Comments
 (0)