]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
USB: usblp: fix DMA to stack
authorJohan Hovold <johan@kernel.org>
Mon, 4 Jan 2021 14:53:02 +0000 (15:53 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 19 Feb 2021 15:43:58 +0000 (16:43 +0100)
commit9c0e6a66eb21355defd636e0db17609a39fd5cc2
treed3b0829e9ad6611bed8d941cda035147632dd819
parent26071f94c87e571b374baf15816d4679d547c786
USB: usblp: fix DMA to stack

BugLink: https://bugs.launchpad.net/bugs/1913486
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
drivers/usb/class/usblp.c