lkml.org 
[lkml]   [2012]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[47/65] USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB core
    3.0-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Bjørn Mork <bjorn@mork.no>

    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 | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/usb/class/cdc-wdm.c
    +++ b/drivers/usb/class/cdc-wdm.c
    @@ -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)

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-02-01 22:11    [W:0.023 / U:0.140 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site