mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
media: rc: igorplugusb: heed coherency rules
In a control request, the USB request structure
can be subject to DMA on some HCs. Hence it must obey
the rules for DMA coherency. Allocate it separately.
Fixes: b1c97193c6 ("[media] rc: port IgorPlug-USB to rc-core")
Cc: stable@vger.kernel.org
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
e280d1e5e3
commit
eac69475b0
|
|
@ -34,7 +34,7 @@ struct igorplugusb {
|
|||
struct device *dev;
|
||||
|
||||
struct urb *urb;
|
||||
struct usb_ctrlrequest request;
|
||||
struct usb_ctrlrequest *request;
|
||||
|
||||
struct timer_list timer;
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ static void igorplugusb_cmd(struct igorplugusb *ir, int cmd)
|
|||
{
|
||||
int ret;
|
||||
|
||||
ir->request.bRequest = cmd;
|
||||
ir->request->bRequest = cmd;
|
||||
ir->urb->transfer_flags = 0;
|
||||
ret = usb_submit_urb(ir->urb, GFP_ATOMIC);
|
||||
if (ret && ret != -EPERM)
|
||||
|
|
@ -164,13 +164,17 @@ static int igorplugusb_probe(struct usb_interface *intf,
|
|||
if (!ir)
|
||||
return -ENOMEM;
|
||||
|
||||
ir->request = kzalloc_obj(*ir->request, GFP_KERNEL);
|
||||
if (!ir->request)
|
||||
goto fail;
|
||||
|
||||
ir->dev = &intf->dev;
|
||||
|
||||
timer_setup(&ir->timer, igorplugusb_timer, 0);
|
||||
|
||||
ir->request.bRequest = GET_INFRACODE;
|
||||
ir->request.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN;
|
||||
ir->request.wLength = cpu_to_le16(MAX_PACKET);
|
||||
ir->request->bRequest = GET_INFRACODE;
|
||||
ir->request->bRequestType = USB_TYPE_VENDOR | USB_DIR_IN;
|
||||
ir->request->wLength = cpu_to_le16(MAX_PACKET);
|
||||
|
||||
ir->urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (!ir->urb)
|
||||
|
|
@ -228,6 +232,7 @@ static int igorplugusb_probe(struct usb_interface *intf,
|
|||
usb_free_urb(ir->urb);
|
||||
rc_free_device(ir->rc);
|
||||
kfree(ir->buf_in);
|
||||
kfree(ir->request);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -244,6 +249,7 @@ static void igorplugusb_disconnect(struct usb_interface *intf)
|
|||
usb_free_urb(ir->urb);
|
||||
rc_free_device(ir->rc);
|
||||
kfree(ir->buf_in);
|
||||
kfree(ir->request);
|
||||
}
|
||||
|
||||
static const struct usb_device_id igorplugusb_table[] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user