mei: fix NULL dereferencing during FW initiated disconnection
authorAlexander Usyskin <alexander.usyskin@intel.com>
Sun, 17 Apr 2016 16:16:03 +0000 (12:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Jun 2016 19:15:50 +0000 (12:15 -0700)
commit2826506a7fc8a165292b109c5ad4456d60b1e580
treeb2f1f1dc09011197e860772b474ab1763f34af08
parent2ceff6c403894da9de23a52c20bfcd81d8659a50
mei: fix NULL dereferencing during FW initiated disconnection

commit 6a8d648c8d1824117a9e9edb948ed1611fb013c0 upstream.

In the case when disconnection is initiated from the FW
the driver is flushing items from the write control list while
iterating over it:

mei_irq_write_handler()
    list_for_each_entry_safe(ctrl_wr_list)         <-- outer loop
         mei_cl_irq_disconnect_rsp()
             mei_cl_set_disconnected()
                 mei_io_list_flush(ctrl_wr_list)   <-- destorying list

We move the list flushing to the completion routine.

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>
drivers/misc/mei/client.c
drivers/misc/mei/hbm.c
drivers/misc/mei/interrupt.c