summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2026-06-16 05:09:36 -0700
committerArd Biesheuvel <ardb@kernel.org>2026-08-20 14:45:05 +0300
commitc554d4e534bbfc9d88ffdbfeea754b4111843608 (patch)
treebece41aaec23df02cb86587b9a028b192c6d00d4
parentecbccdbdab5d31e1e465e3f789d57bb34e5452cd (diff)
downloadlinux-c554d4e534bbfc9d88ffdbfeea754b4111843608.tar.gz
linux-c554d4e534bbfc9d88ffdbfeea754b4111843608.zip
efi/runtime-wrappers: handle queue_work() failure with goto exit
Convert the queue_work() failure path in __efi_queue_work() to a goto exit instead of falling through to the wait and the WARN_ON_ONCE(status == EFI_ABORTED) below it. A failed queue_work() leaves the status at its initial EFI_ABORTED, so that warning would fire even though no call ran; it is meant for a completed call that returned EFI_ABORTED. No change for the common (successful enqueue) path. This also prepares __efi_queue_work() for the timeout handling added later. Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r--drivers/firmware/efi/runtime-wrappers.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c
index dc2e5c370edc..4ff51860ccf5 100644
--- a/drivers/firmware/efi/runtime-wrappers.c
+++ b/drivers/firmware/efi/runtime-wrappers.c
@@ -351,10 +351,12 @@ static efi_status_t __efi_queue_work(enum efi_rts_ids id,
* queue_work() returns 0 if work was already on queue,
* _ideally_ this should never happen.
*/
- if (queue_work(efi_rts_wq, &efi_rts_work.work))
- wait_for_completion(&efi_rts_work.efi_rts_comp);
- else
+ if (!queue_work(efi_rts_wq, &efi_rts_work.work)) {
pr_err("Failed to queue work to efi_rts_wq.\n");
+ goto exit;
+ }
+
+ wait_for_completion(&efi_rts_work.efi_rts_comp);
WARN_ON_ONCE(efi_rts_work.status == EFI_ABORTED);
exit: