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

    mei: clear write cb from waiting list on reset

to my char-misc git tree which can be found at
    git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.

The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.

If you have any questions about this process, please let me know.


>From 30c54df7cb9b15b222529a028390b9c9582dd65e Mon Sep 17 00:00:00 2001
From: Alexander Usyskin <[email protected]>
Date: Mon, 27 Jan 2014 22:27:23 +0200
Subject: mei: clear write cb from waiting list on reset

Clear write callbacks sitting in write_waiting list on reset.
Otherwise these callbacks are left dangling and cause memory leak.

Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/misc/mei/client.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 1ee2b9492a82..ccdacb5fcd8b 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -942,8 +942,16 @@ void mei_cl_all_wakeup(struct mei_device *dev)
 void mei_cl_all_write_clear(struct mei_device *dev)
 {
        struct mei_cl_cb *cb, *next;
+       struct list_head *list;
 
-       list_for_each_entry_safe(cb, next, &dev->write_list.list, list) {
+       list = &dev->write_list.list;
+       list_for_each_entry_safe(cb, next, list, list) {
+               list_del(&cb->list);
+               mei_io_cb_free(cb);
+       }
+
+       list = &dev->write_waiting_list.list;
+       list_for_each_entry_safe(cb, next, list, list) {
                list_del(&cb->list);
                mei_io_cb_free(cb);
        }
-- 
1.8.5.1.163.gd7aced9


--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to