]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
cfaa8e8ec32c7637bc94356c5948b76354ece4ac
[thirdparty/kernel/stable-queue.git] /
1 From 655e247daf52b202a6c2d0f8a06dd2051e756ce4 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
3 Date: Mon, 16 Jan 2012 15:11:59 +0100
4 Subject: USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB core
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: Bjørn Mork <bjorn@mork.no>
10
11 commit 655e247daf52b202a6c2d0f8a06dd2051e756ce4 upstream.
12
13 As it turns out, there was a mismatch between the allocated inbuf size
14 (desc->bMaxPacketSize0, typically something like 64) and the length we
15 specified in the URB (desc->wMaxCommand, typically something like 2048)
16
17 Signed-off-by: Bjørn Mork <bjorn@mork.no>
18 Cc: Oliver Neukum <oliver@neukum.org>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21 ---
22 drivers/usb/class/cdc-wdm.c | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25 --- a/drivers/usb/class/cdc-wdm.c
26 +++ b/drivers/usb/class/cdc-wdm.c
27 @@ -723,7 +723,7 @@ next_desc:
28 goto err;
29
30 desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf),
31 - desc->bMaxPacketSize0,
32 + desc->wMaxCommand,
33 GFP_KERNEL,
34 &desc->response->transfer_dma);
35 if (!desc->inbuf)