Commit 6537ae2f authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: amthif: clean command queue upon disconnection

In order to prevent memory leak clean up the amthif command
queue upon disconnection. The issue may happen only on error path
as the command queue is cleaned upon file descriptor close.
And remove the cleanup from mei_cl_flush_queues as this code
is never reached for amthif client.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c0d6701
...@@ -546,7 +546,6 @@ int mei_cl_flush_queues(struct mei_cl *cl, const struct file *fp) ...@@ -546,7 +546,6 @@ int mei_cl_flush_queues(struct mei_cl *cl, const struct file *fp)
mei_io_list_free(&cl->dev->write_waiting_list, cl); mei_io_list_free(&cl->dev->write_waiting_list, cl);
mei_io_list_flush(&cl->dev->ctrl_wr_list, cl); mei_io_list_flush(&cl->dev->ctrl_wr_list, cl);
mei_io_list_flush(&cl->dev->ctrl_rd_list, cl); mei_io_list_flush(&cl->dev->ctrl_rd_list, cl);
mei_io_list_flush(&cl->dev->amthif_cmd_list, cl);
mei_cl_read_cb_flush(cl, fp); mei_cl_read_cb_flush(cl, fp);
...@@ -769,6 +768,7 @@ static void mei_cl_set_disconnected(struct mei_cl *cl) ...@@ -769,6 +768,7 @@ static void mei_cl_set_disconnected(struct mei_cl *cl)
mei_io_list_free(&dev->write_waiting_list, cl); mei_io_list_free(&dev->write_waiting_list, cl);
mei_io_list_flush(&dev->ctrl_rd_list, cl); mei_io_list_flush(&dev->ctrl_rd_list, cl);
mei_io_list_flush(&dev->ctrl_wr_list, cl); mei_io_list_flush(&dev->ctrl_wr_list, cl);
mei_io_list_free(&dev->amthif_cmd_list, cl);
mei_cl_wake_all(cl); mei_cl_wake_all(cl);
cl->rx_flow_ctrl_creds = 0; cl->rx_flow_ctrl_creds = 0;
cl->tx_flow_ctrl_creds = 0; cl->tx_flow_ctrl_creds = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment