diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 98c4f28ad2a1e7..453958892a69bb 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -957,13 +957,14 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, timeout = MAX_JIFFY_OFFSET; } - retval = wait_for_completion_interruptible_timeout(&buf->completion, + timeout = wait_for_completion_interruptible_timeout(&buf->completion, timeout); - if (retval == -ERESTARTSYS || !retval) { + if (timeout == -ERESTARTSYS || !timeout) { + retval = timeout; mutex_lock(&fw_lock); fw_load_abort(fw_priv); mutex_unlock(&fw_lock); - } else if (retval > 0) { + } else if (timeout > 0) { retval = 0; }