Skip to content

Commit 0cb6424

Browse files
Ming Leigregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3c1556b commit 0cb6424

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/base/firmware_class.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,13 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
927927
retval = wait_for_completion_interruptible(&buf->completion);
928928

929929
cancel_delayed_work_sync(&fw_priv->timeout_work);
930+
931+
if (retval == -ERESTARTSYS) {
932+
mutex_lock(&fw_lock);
933+
fw_load_abort(fw_priv);
934+
mutex_unlock(&fw_lock);
935+
}
936+
930937
if (is_fw_load_aborted(buf))
931938
retval = -EAGAIN;
932939
else if (!buf->data)

0 commit comments

Comments
 (0)