From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B44C51DDCE; Tue, 16 Jul 2024 16:08:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721146124; cv=none; b=CPlDDfYQnYEUb+D57DjIxxbngEZMqKcpX9VQ1OVK+JVhXwWf7OEoLU26L3HmzL6MXPqN5HaUWdvLqvp7B71VqGyCCXQwDnUKNgs901lxT+V71kprl9EYjkRrWhZJiiZN8zuDfPuDN9HFTbFYwlGYNt7HjfwziP+qIRwDpfTn8No= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721146124; c=relaxed/simple; bh=7Z7zAaOfM3vyL0kQBhmkGfjnol9R+sy9FoRa9C6pXfk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sjMZGWa54R/Mb56+/bheiFNIYqP6TUppJrJW4fGFanLX7TmRC+9+2lq14kXFBaroWTj4/nPIMimDcoTh5D3hzWzPwT0fDL1p/zd45Ajmnpoc0hGjb5dQa+jSadav5ZTigee3OCllC/eGfDSNtVL9ieoyDszDJgo0SDwPpMOtajU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=b8AvcOlO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="b8AvcOlO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3357BC116B1; Tue, 16 Jul 2024 16:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721146124; bh=7Z7zAaOfM3vyL0kQBhmkGfjnol9R+sy9FoRa9C6pXfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b8AvcOlOIsN1/s1quBKt5DCKhJ/Qweur20G8TXZ8tJIfVMoXqMx+bndMnP3jtbLT0 m3SlxJRFMOP3IW9tjDxpkgyAweUvo+AGkcdIFkOiR4uGY9p5wDfV6FZCqGdTYi6/nM bZicXIpWoi+K5KAW8tqSMs+HWIkcc64WUeT2Otds= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Brendan Higgins , Shuah Khan , Kees Cook , David Gow , Rae Moar , =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Sasha Levin Subject: [PATCH 5.15 024/144] kunit: Fix timeout message Date: Tue, 16 Jul 2024 17:31:33 +0200 Message-ID: <20240716152753.465654701@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240716152752.524497140@linuxfoundation.org> References: <20240716152752.524497140@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mickaël Salaün [ Upstream commit 53026ff63bb07c04a0e962a74723eb10ff6f9dc7 ] The exit code is always checked, so let's properly handle the -ETIMEDOUT error code. Cc: Brendan Higgins Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: David Gow Reviewed-by: Rae Moar Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240408074625.65017-4-mic@digikod.net Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- lib/kunit/try-catch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/kunit/try-catch.c b/lib/kunit/try-catch.c index 71e5c58530996..d18da926b2cd7 100644 --- a/lib/kunit/try-catch.c +++ b/lib/kunit/try-catch.c @@ -76,7 +76,6 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context) time_remaining = wait_for_completion_timeout(&try_completion, kunit_test_timeout()); if (time_remaining == 0) { - kunit_err(test, "try timed out\n"); try_catch->try_result = -ETIMEDOUT; } @@ -89,6 +88,8 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context) try_catch->try_result = 0; else if (exit_code == -EINTR) kunit_err(test, "wake_up_process() was never called\n"); + else if (exit_code == -ETIMEDOUT) + kunit_err(test, "try timed out\n"); else if (exit_code) kunit_err(test, "Unknown error: %d\n", exit_code); -- 2.43.0