summaryrefslogtreecommitdiff
path: root/drivers/base/firmware_class.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2015-01-13 00:01:35 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-03 15:33:10 -0800
commit0cb64249ca50033ec22e63582837f94202c63d9f (patch)
tree9f186d01538ae38afd325e9a64593c158db8a3a6 /drivers/base/firmware_class.c
parent3c1556b287b89686fc7b4a210b82174938bb8a02 (diff)
firmware_loader: abort request if wait_for_completion is interrupted
If current request is interrupted by signal, such as 'ctrl + c', this request has to be aborted for the following reasons: - the buf need to be removed from pending list - same requests from other contexts need to be completed Reported-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_class.c')
-rw-r--r--drivers/base/firmware_class.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 96d994a35372..5870ec35efe6 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -927,6 +927,13 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
retval = wait_for_completion_interruptible(&buf->completion);
cancel_delayed_work_sync(&fw_priv->timeout_work);
+
+ if (retval == -ERESTARTSYS) {
+ mutex_lock(&fw_lock);
+ fw_load_abort(fw_priv);
+ mutex_unlock(&fw_lock);
+ }
+
if (is_fw_load_aborted(buf))
retval = -EAGAIN;
else if (!buf->data)