Patch "usb: chipidea: udc: fix memory leak in _ep_nuke" has been added to the 3.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    usb: chipidea: udc: fix memory leak in _ep_nuke

to the 3.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-chipidea-udc-fix-memory-leak-in-_ep_nuke.patch
and it can be found in the queue-3.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 7ca2cd291fd84ae499390f227a255ccba2780a81 Mon Sep 17 00:00:00 2001
From: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
Date: Thu, 4 Apr 2013 13:13:47 +0300
Subject: usb: chipidea: udc: fix memory leak in _ep_nuke

From: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>

commit 7ca2cd291fd84ae499390f227a255ccba2780a81 upstream.

In hardware_enqueue code adds one extra td with dma_pool_alloc if
mReq->req.zero is true. When _ep_nuke will be called for that endpoint,
dma_pool_free will not be called to free that memory again. That patch
fixes this.

Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
Signed-off-by: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/usb/chipidea/udc.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -563,6 +563,12 @@ __acquires(mEp->lock)
 		struct ci13xxx_req *mReq = \
 			list_entry(mEp->qh.queue.next,
 				   struct ci13xxx_req, queue);
+
+		if (mReq->zptr) {
+			dma_pool_free(mEp->td_pool, mReq->zptr, mReq->zdma);
+			mReq->zptr = NULL;
+		}
+
 		list_del_init(&mReq->queue);
 		mReq->req.status = -ESHUTDOWN;
 


Patches currently in stable-queue which might be from m.grzeschik@xxxxxxxxxxxxxx are

queue-3.9/usb-chipidea-udc-fix-memory-leak-in-_ep_nuke.patch
queue-3.9/usb-chipidea-udc-fix-memory-access-of-shared-memory-on-armv5-machines.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]