Commit 9e6cb786 authored by Herton Ronaldo Krzesinski's avatar Herton Ronaldo Krzesinski Committed by Ben Hutchings

USB: cdc-wdm: fix regression on buffer deallocation

[ no commit upstream, since usb_alloc_coherent usage was removed from
  the driver before this was fixed ]

Commit cafbe85f ("USB: cdc-wdm: better allocate a buffer that is at least
as big as we tell the USB core") introduced a regression: it changed
the size used in usb_alloc_coherent, but failed to do the same for the
usb_free_coherent calls.

It also was marked for stable and got backported to older kernels. But
in the upstream kernel, the usage of usb_alloc_coherent was right after
removed from the driver, so upstream doesn't have this problem, while
the stable kernels still have, and thus need this fix.

BugLink: https://bugs.launchpad.net/bugs/1074157Signed-off-by: default avatarHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 1bb6f0ef
......@@ -301,7 +301,7 @@ static void cleanup(struct wdm_device *desc)
desc->sbuf,
desc->validity->transfer_dma);
usb_free_coherent(interface_to_usbdev(desc->intf),
desc->bMaxPacketSize0,
desc->wMaxCommand,
desc->inbuf,
desc->response->transfer_dma);
kfree(desc->orq);
......@@ -788,7 +788,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
err3:
usb_set_intfdata(intf, NULL);
usb_free_coherent(interface_to_usbdev(desc->intf),
desc->bMaxPacketSize0,
desc->wMaxCommand,
desc->inbuf,
desc->response->transfer_dma);
err2:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment