Skip to content

Commit

Permalink
USB: cdc-wdm: better allocate a buffer that is at least as big as we …
Browse files Browse the repository at this point in the history
…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: Bjørn Mork <bjorn@mork.no>
Cc: Oliver Neukum <oliver@neukum.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Bjørn Mork authored and Greg Kroah-Hartman committed Jan 24, 2012
1 parent 62aaf24 commit 655e247
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/class/cdc-wdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
goto err;

desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
desc->bMaxPacketSize0,
desc->wMaxCommand,
GFP_KERNEL,
&desc->response->transfer_dma);
if (!desc->inbuf)
Expand Down

0 comments on commit 655e247

Please sign in to comment.