From: Bjørn Mork Date: Mon, 16 Jan 2012 14:11:59 +0000 (+0100) Subject: USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB... X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cafbe85fb0d00d32988905c4978df433ca9b6512;p=linux-beck.git 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: Bjørn Mork Cc: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 9734863a3a49..846dfa603447 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -696,7 +696,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)