Skip to content

Commit d6bb878

Browse files
GustavoARSilvaVudentz
authored andcommitted
Bluetooth: hci_conn: Use struct_size() in hci_le_big_create_sync()
Use struct_size() instead of the open-coded version. Similarly to this other patch[1]. Link: https://lore.kernel.org/linux-hardening/ZiwwPmCvU25YzWek@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 4322502 commit d6bb878

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/bluetooth/hci_conn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,7 @@ int hci_le_big_create_sync(struct hci_dev *hdev, struct hci_conn *hcon,
21322132
memcpy(pdu->bis, bis, num_bis);
21332133

21342134
return hci_send_cmd(hdev, HCI_OP_LE_BIG_CREATE_SYNC,
2135-
sizeof(*pdu) + num_bis, pdu);
2135+
struct_size(pdu, bis, num_bis), pdu);
21362136
}
21372137

21382138
static void create_big_complete(struct hci_dev *hdev, void *data, int err)

0 commit comments

Comments
 (0)