Skip to content

Commit 30c54df

Browse files
ausyskingregkh
authored andcommitted
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]>
1 parent 38dbfb5 commit 30c54df

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/misc/mei/client.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,16 @@ void mei_cl_all_wakeup(struct mei_device *dev)
942942
void mei_cl_all_write_clear(struct mei_device *dev)
943943
{
944944
struct mei_cl_cb *cb, *next;
945+
struct list_head *list;
945946

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) {
947955
list_del(&cb->list);
948956
mei_io_cb_free(cb);
949957
}

0 commit comments

Comments
 (0)