]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB...
authorBjørn Mork <bjorn@mork.no>
Mon, 16 Jan 2012 14:11:59 +0000 (15:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Feb 2012 17:22:17 +0000 (09:22 -0800)
commit 655e247daf52b202a6c2d0f8a06dd2051e756ce4 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-wdm.c

index d2cda2607bd5563ce123127112ca5832fbde8a23..f0deb9ef6838d3f875b55946237278159ee106e5 100644 (file)
@@ -723,7 +723,7 @@ next_desc:
                goto err;
 
        desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
-                                        desc->bMaxPacketSize0,
+                                        desc->wMaxCommand,
                                         GFP_KERNEL,
                                         &desc->response->transfer_dma);
        if (!desc->inbuf)