Thread (7 messages) flat view 7 messages, 4 authors, 2021-01-06

Re: [PATCH] USB: usblp: fix DMA to stack

From: Johan Hovold <johan@kernel.org>
Date: 2021-01-06 11:26:25
Also in: stable

On Mon, Jan 04, 2021 at 11:37:36AM -0600, Pete Zaitcev wrote:
On Mon,  4 Jan 2021 15:53:02 +0100
Johan Hovold [off-list ref] wrote:
quoted
+++ b/drivers/usb/class/usblp.c
-#define usblp_hp_channel_change_request(usblp, channel, buffer) \
-	usblp_ctrl_msg(usblp, USBLP_REQ_HP_CHANNEL_CHANGE_REQUEST, USB_TYPE_VENDOR, USB_DIR_IN, USB_RECIP_INTERFACE, channel, buffer, 1)
+static int usblp_hp_channel_change_request(struct usblp *usblp, int channel, u8 *new_channel)
Acked-By: Pete Zaitcev <zaitcev@redhat.com>

I would probably get rid of the buffer pointer and return
new_channel & 0xFF in case of success. That would kill
the newChannel too, and there's no need to debage u8 versus
unsigned char. But this is good enough. A function is better
than trying to cram the kfree() into the clause of the switch.
Yeah, I wanted a minimal change suitable for stable and the helper was
already there to be used for this.

Johan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help