Skip to content

Commit

Permalink
firmware_loader: abort request if wait_for_completion is interrupted
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ming Lei authored and gregkh committed Feb 3, 2015
1 parent 3c1556b commit 0cb6424
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0cb6424

Please sign in to comment.