hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/bluetooth/a2mp.c
....@@ -1,15 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved.
34 Copyright (c) 2011,2012 Intel Corp.
45
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License version 2 and
7
- only version 2 as published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
136 */
147
158 #include <net/bluetooth/bluetooth.h>
....@@ -63,7 +56,7 @@
6356
6457 memset(&msg, 0, sizeof(msg));
6558
66
- iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, &iv, 1, total_len);
59
+ iov_iter_kvec(&msg.msg_iter, WRITE, &iv, 1, total_len);
6760
6861 l2cap_chan_send(chan, &msg, total_len);
6962
....@@ -174,7 +167,7 @@
174167 num_ctrl++;
175168 }
176169
177
- len = num_ctrl * sizeof(struct a2mp_cl) + sizeof(*rsp);
170
+ len = struct_size(rsp, cl, num_ctrl);
178171 rsp = kmalloc(len, GFP_ATOMIC);
179172 if (!rsp) {
180173 read_unlock(&hci_dev_list_lock);