From: Tomas Winkler <tomas.winkler@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alexander Usyskin <alexander.usyskin@intel.com>,
linux-kernel@vger.kernel.org,
Tomas Winkler <tomas.winkler@intel.com>
Subject: [char-misc-next 6/9] mei: amthif: clean command queue upon disconnection
Date: Fri, 27 Jan 2017 16:32:43 +0200 [thread overview]
Message-ID: <1485527566-13653-6-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1485527566-13653-1-git-send-email-tomas.winkler@intel.com>
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: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
drivers/misc/mei/client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 923fad39535c..d9e3e68bab89 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -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_flush(&cl->dev->ctrl_wr_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);
@@ -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_flush(&dev->ctrl_rd_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);
cl->rx_flow_ctrl_creds = 0;
cl->tx_flow_ctrl_creds = 0;
--
2.7.4
next prev parent reply other threads:[~2017-01-27 13:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 14:32 [char-misc-next 1/9] mei: bus: cancel and disable callback after release call Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 2/9] mei: bus: prevent hardware module unload if device on bus is active Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 3/9] mei: bus: unregister callbacks upon me client disable call Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 4/9] mei: return error on notification request to a disconnected client Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 5/9] mei: abort waiting for notification on unsupported HW Tomas Winkler
2017-01-27 14:32 ` Tomas Winkler [this message]
2017-01-27 14:32 ` [char-misc-next 7/9] mei: amthif: allow the read completion after close Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 8/9] mei: replace callback structures used as list head by list_head Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 9/9] mei: revamp io list cleanup function Tomas Winkler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485527566-13653-6-git-send-email-tomas.winkler@intel.com \
--to=tomas.winkler@intel.com \
--cc=alexander.usyskin@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®