Commit 655e247d authored by Bjørn Mork's avatar Bjørn Mork Committed by Greg Kroah-Hartman

USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB core

As it turns out, there was a mismatch between the allocated inbuf size
(desc->bMaxPacketSize0, typically something like 64) and the length we
specified in the URB (desc->wMaxCommand, typically something like 2048)
Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
Cc: Oliver Neukum <oliver@neukum.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 62aaf24d
...@@ -723,7 +723,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -723,7 +723,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
goto err; goto err;
desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf), desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
desc->bMaxPacketSize0, desc->wMaxCommand,
GFP_KERNEL, GFP_KERNEL,
&desc->response->transfer_dma); &desc->response->transfer_dma);
if (!desc->inbuf) if (!desc->inbuf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment