diff options
author | Alexander Usyskin <alexander.usyskin@intel.com> | 2014-01-27 15:27:23 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 11:16:14 -0500 |
commit | 30c54df7cb9b15b222529a028390b9c9582dd65e (patch) | |
tree | 96cb70514499ac6f046655942faae84d91d7f4c3 | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) |
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 <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/mei/client.c | 10 |
1 files changed, 9 insertions, 1 deletions
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) | |||
942 | void mei_cl_all_write_clear(struct mei_device *dev) | 942 | void mei_cl_all_write_clear(struct mei_device *dev) |
943 | { | 943 | { |
944 | struct mei_cl_cb *cb, *next; | 944 | struct mei_cl_cb *cb, *next; |
945 | struct list_head *list; | ||
945 | 946 | ||
946 | list_for_each_entry_safe(cb, next, &dev->write_list.list, list) { | 947 | list = &dev->write_list.list; |
948 | list_for_each_entry_safe(cb, next, list, list) { | ||
949 | list_del(&cb->list); | ||
950 | mei_io_cb_free(cb); | ||
951 | } | ||
952 | |||
953 | list = &dev->write_waiting_list.list; | ||
954 | list_for_each_entry_safe(cb, next, list, list) { | ||
947 | list_del(&cb->list); | 955 | list_del(&cb->list); |
948 | mei_io_cb_free(cb); | 956 | mei_io_cb_free(cb); |
949 | } | 957 | } |