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

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

From: Pete Zaitcev <zaitcev@redhat.com>
Date: 2021-01-04 17:39:06
Also in: stable

On Mon,  4 Jan 2021 15:53:02 +0100
Johan Hovold [off-list ref] wrote:
quoted hunk ↗ jump to hunk
+++ 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.

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