From patchwork Fri Dec 14 13:12:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herton Ronaldo Krzesinski X-Patchwork-Id: 206449 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 4C76C2C008A for ; Sat, 15 Dec 2012 00:12:18 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TjV3h-0004kC-TW; Fri, 14 Dec 2012 13:12:09 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TjV3g-0004k2-Qd for kernel-team@lists.ubuntu.com; Fri, 14 Dec 2012 13:12:08 +0000 Received: from [189.115.84.109] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TjV3g-00038x-4z; Fri, 14 Dec 2012 13:12:08 +0000 From: Herton Ronaldo Krzesinski To: Ubuntu Kernel Team Subject: [Oneiric/Precise SRU][PATCH] UBUNTU: SAUCE: usb: cdc-wdm: fix regression on buffer deallocation Date: Fri, 14 Dec 2012 11:12:00 -0200 Message-Id: <1355490720-5119-2-git-send-email-herton.krzesinski@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1355490720-5119-1-git-send-email-herton.krzesinski@canonical.com> References: <1355490720-5119-1-git-send-email-herton.krzesinski@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Commit cafbe85 ("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. For now, just fix the usb_free_coherent calls to match the usb_alloc_coherent change. BugLink: https://bugs.launchpad.net/bugs/1074157 Signed-off-by: Herton Ronaldo Krzesinski Acked-by: Colin Ian King Acked-by: Ming Lei --- drivers/usb/class/cdc-wdm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 9aaed0d..97b2c55 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -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 @@ out: 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: