]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
efi/efi_test: Fix missing pending status update in getwakeuptime
authorIvan Hu <ivan.hu@canonical.com>
Mon, 31 Mar 2025 07:45:04 +0000 (15:45 +0800)
committerArd Biesheuvel <ardb@kernel.org>
Wed, 21 May 2025 13:39:30 +0000 (15:39 +0200)
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>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/test/efi_test.c

index 9e2628728aadc74f439d66a19f5581a237503a68..77b5f7ac3e20c91cb2b25c5432f6d6d3f48911fe 100644 (file)
@@ -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)))