Skip to content

Commit cee4c4d

Browse files
ausyskingregkh
authored andcommitted
mei: free read cb on ctrl_wr list flush
There is a little window during disconnection flow when read cb is moved between lists and may be not freed. Remove moving read cbs explicitly during flash fixes this memory leak. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c4a46ac commit cee4c4d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/misc/mei/client.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,11 @@ static void mei_io_list_flush_cl(struct list_head *head,
401401
struct mei_cl_cb *cb, *next;
402402

403403
list_for_each_entry_safe(cb, next, head, list) {
404-
if (cl == cb->cl)
404+
if (cl == cb->cl) {
405405
list_del_init(&cb->list);
406+
if (cb->fop_type == MEI_FOP_READ)
407+
mei_io_cb_free(cb);
408+
}
406409
}
407410
}
408411

0 commit comments

Comments
 (0)