efi_loader: LocateHandle should return EFI_NOT_FOUND if none found
PATCH 1/1 efi_loader: LocateHandle should return EFI_NOT_FOUND if none found
Spotted this debugging OpenBSD's bootloader in qemu. (Wouldn't really fix anything, the problem was not having any disks, but we should probably return the correct error code.)
--- lib/efi_loader/efi_boottime.c | 3 +++ 1 file changed, 3 insertions(+)
lib/efi_loader/efi_boottime.c +3 -0
@@ -643,6 +643,9 @@ static efi_status_t EFIAPI efi_locate_handle( } *buffer_size = size; +if (size ==0 ) +return EFI_NOT_FOUND ; +return EFI_SUCCESS ; }
Signature · 1 line
2.13.0
PATCH 1/1 efi_loader: LocateHandle should return EFI_NOT_FOUND if none found
Quoted 15 lines · Rob Clark
Spotted this debugging OpenBSD's bootloader in qemu. (Wouldn't really fix anything, the problem was not having any disks, but we should probably return the correct error code.)
Signed-off-by Rob Clark <[email protected]>--- lib/efi_loader/efi_boottime.c | 3 +++ 1 file changed, 3 insertions(+)lib/efi_loader/efi_boottime.c +0
-0
lib/efi_loader/efi_boottime.c static efi_status_t EFIAPI efi_locate_handle( · line 651
Quoted 9 lines
lib/efi_loader/efi_boottime.c +3
-0@@ -643,6 +643,9 @@ static efi_status_t EFIAPI efi_locate_handle( } *buffer_size = size; +if (size ==0 ) +return EFI_NOT_FOUND ; +return EFI_SUCCESS ; }
Thanks for spotting this.
We can do the test earlier, if we move
*buffer_size = size;
to another line.
test:
...
size += sizeof(void*);
}
}
if (*buffer_size < size) {
*buffer_size = size;
return EFI_BUFFER_TOO_SMALL;
}
*buffer_size = size;
if (size == 0)
return EFI_NOT_FOUND;
/* Then fill the array */...
Best regards
Heinrich
PATCH 1/1 efi_loader: LocateHandle should return EFI_NOT_FOUND if none found
In reply to Rob ClarkQuoted 8 lines
From: Rob Clark <[email protected]>
Date: Sun, 6 Aug 2017 12:23:50 -0400Spotted this debugging OpenBSD's bootloader in qemu. (Wouldn't really fix anything, the problem was not having any disks, but we should probably return the correct error code.)
Signed-off-by Rob Clark <[email protected]>
Quoted 27 lines
--- lib/efi_loader/efi_boottime.c | 3 +++ 1 file changed, 3 insertions(+)lib/efi_loader/efi_boottime.c +3
-0@@ -643,6 +643,9 @@ static efi_status_t EFIAPI efi_locate_handle( } *buffer_size = size; +if (size ==0 ) +return EFI_NOT_FOUND ; +return EFI_SUCCESS ; }Signature · 6 lines
2.13.0 _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de https://lists.denx.de/listinfo/u-boot