Arnd Bergmann 10888140f0 Bluetooth: btusb: fix excessive stack usage
Enlarging the size of 'struct btmtk_hci_wmt_cmd' makes it no longer
fit on the kernel stack, as seen from this compiler warning:

drivers/bluetooth/btusb.c:3365:12: error: stack frame size of 1036 bytes in function 'btusb_mtk_hci_wmt_sync' [-Werror,-Wframe-larger-than=]

Change the function to dynamically allocate the buffer instead.
As there are other sleeping functions called from the same location,
using GFP_KERNEL should be fine here, and the runtime overhead should
not matter as this is rarely called.

Unfortunately, I could not figure out why the message size is
increased in the previous patch. Using dynamic allocation means
any size is possible now, but there is still a range check that
limits the total size (including the five-byte header) to 255
bytes, so whatever was intended there is now undone.

Fixes: 48c13301e6ba ("Bluetooth: btusb: Fine-tune mt7663 mechanism.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-02-04 18:11:23 +01:00
..
2020-12-15 14:02:26 -08:00
2020-10-30 14:51:01 -07:00
2020-12-15 14:02:26 -08:00
2020-12-15 13:22:29 -08:00
2020-11-20 10:23:49 -08:00
2020-12-07 10:08:14 +01:00
2020-11-16 15:02:33 -08:00
2020-12-03 10:00:23 +01:00
2020-10-24 10:39:22 -07:00
2020-12-15 13:22:29 -08:00
2020-10-24 10:39:22 -07:00
2020-10-14 15:56:58 -07:00
2020-12-15 13:22:29 -08:00
2020-10-25 11:12:31 -07:00
2020-12-15 14:02:26 -08:00
2020-10-27 19:23:04 +01:00
2020-10-24 10:33:08 -07:00
2020-10-22 12:56:33 -07:00
2020-10-24 10:39:22 -07:00
2020-10-22 12:58:21 -07:00
2020-12-15 13:22:29 -08:00
2020-12-15 13:22:29 -08:00
2020-12-10 10:45:36 +01:00
2020-11-20 16:24:28 -08:00
2020-12-15 13:57:14 -08:00
2020-12-15 12:13:37 -08:00
2020-12-14 11:07:56 -08:00
2020-12-09 19:44:34 +01:00
2020-10-24 10:33:08 -07:00