| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved. |
|---|
| 3 | 4 | Copyright (c) 2011,2012 Intel Corp. |
|---|
| 4 | 5 | |
|---|
| 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. |
|---|
| 13 | 6 | */ |
|---|
| 14 | 7 | |
|---|
| 15 | 8 | #include <net/bluetooth/bluetooth.h> |
|---|
| .. | .. |
|---|
| 63 | 56 | |
|---|
| 64 | 57 | memset(&msg, 0, sizeof(msg)); |
|---|
| 65 | 58 | |
|---|
| 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); |
|---|
| 67 | 60 | |
|---|
| 68 | 61 | l2cap_chan_send(chan, &msg, total_len); |
|---|
| 69 | 62 | |
|---|
| .. | .. |
|---|
| 174 | 167 | num_ctrl++; |
|---|
| 175 | 168 | } |
|---|
| 176 | 169 | |
|---|
| 177 | | - len = num_ctrl * sizeof(struct a2mp_cl) + sizeof(*rsp); |
|---|
| 170 | + len = struct_size(rsp, cl, num_ctrl); |
|---|
| 178 | 171 | rsp = kmalloc(len, GFP_ATOMIC); |
|---|
| 179 | 172 | if (!rsp) { |
|---|
| 180 | 173 | read_unlock(&hci_dev_list_lock); |
|---|