diff mbox series

efi/efi_test: Fix missing pending status update in getwakeuptime

Message ID 20250331074504.4096087-1-ivan.hu@canonical.com
State New
Headers show
Series efi/efi_test: Fix missing pending status update in getwakeuptime | expand

Commit Message

Ivan Hu March 31, 2025, 7:45 a.m. UTC
The pending status was not being passed to user space, leading to
false test alarms when using the pending status. This patch ensures
that the pending status is correctly updated and exposed to user space
when calling getwakeuptime, preventing incorrect handling of the pending
status.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 drivers/firmware/efi/test/efi_test.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c
index 9e2628728aad..77b5f7ac3e20 100644
--- a/drivers/firmware/efi/test/efi_test.c
+++ b/drivers/firmware/efi/test/efi_test.c
@@ -361,6 +361,10 @@  static long efi_runtime_get_waketime(unsigned long arg)
 						getwakeuptime.enabled))
 		return -EFAULT;
 
+	if (getwakeuptime.pending && put_user(pending,
+						getwakeuptime.pending))
+		return -EFAULT;
+
 	if (getwakeuptime.time) {
 		if (copy_to_user(getwakeuptime.time, &efi_time,
 				sizeof(efi_time_t)))