]> www.infradead.org Git - users/dwmw2/linux.git/commit
USB: usblp: fix DMA to stack
authorJohan Hovold <johan@kernel.org>
Mon, 4 Jan 2021 14:53:02 +0000 (15:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 19:09:12 +0000 (20:09 +0100)
commit863f3efde4c67469ea482c66ce4bd974fe12989e
treeba6208e7c26b9dfc3ccbdc85c18884e64c2f2fc0
parent2d701f6fc8d638d00179eb903b00548b42949536
USB: usblp: fix DMA to stack

commit 020a1f453449294926ca548d8d5ca970926e8dfd upstream.

Stack-allocated buffers cannot be used for DMA (on all architectures).

Replace the HP-channel macro with a helper function that allocates a
dedicated transfer buffer so that it can continue to be used with
arguments from the stack.

Note that the buffer is cleared on allocation as usblp_ctrl_msg()
returns success also on short transfers (the buffer is only used for
debugging).

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210104145302.2087-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/usblp.c