mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-04 09:51:57 +00:00
Usb "write" method never copies the input data buffer, it uses the
buffer pointer directly. The fact that it was on the stack made
the buffer ephemeral, and could disappear before the USB transfer
actually occurred. The data transmitted was then random. This commit
converts the transfer buffer to a static buffer, so that it always
exists for the duration of the USB transfer.
Known side-effect: if "read capacity" command is read twice
simultaneously, the same buffer will be used twice. As the capacity of a
USB drive should not change between 2 calls, this side effect can be
ignored.
Signed-off-by: Alexi Demers <alexi.demers@axceta.com>
(cherry picked from commit
|
||
---|---|---|
.. | ||
class | ||
bos_desc.h | ||
bos.c | ||
CMakeLists.txt | ||
Kconfig | ||
os_desc.c | ||
os_desc.h | ||
usb_descriptor.c | ||
usb_descriptor.h | ||
usb_device.c | ||
usb_transfer.c | ||
usb_transfer.h | ||
usb_work_q.c | ||
usb_work_q.h |