Skip to contentSkip to conversation

efi_selftest: illegal cast to pointer in initrddump

PATCH New Heinrich Schuchardt 2 participants 2 messages Mar 14, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_selftest: illegal cast to pointer in initrddump

On 32bit systems u64 cannot directly be cast to void *.

---
 lib/efi_selftest/initrddump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_selftest/initrddump.c +1 -1
index c23a05c718..325951b498 100644
@@ -272,7 +272,7 @@ static efi_status_t get_initrd(void **initrd, efi_uintn_t *initrd_size)
 		error(L"Out of memory\r\n");
 		return ret;
 	}
-	*initrd = (void *)buffer;
+	*initrd = (void *)(uintptr_t)buffer;
 	ret = load_file2_prot->load_file(load_file2_prot, dp, false,
 					 initrd_size, *initrd);
 	if (ret != EFI_SUCCESS) {

--
2.30.1

#1 lore raw

PATCH 1/1 efi_selftest: illegal cast to pointer in initrddump

Quoted 21 lines · Heinrich Schuchardt

On 32bit systems u64 cannot directly be cast to void *.

---
 lib/efi_selftest/initrddump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_selftest/initrddump.c +1 -2
index c23a05c718..325951b498 100644
@@ -272,7 +272,7 @@ static efi_status_t get_initrd(void **initrd, efi_uintn_t *initrd_size)
 		error(L"Out of memory\r\n");
 		return ret;
 	}
-	*initrd = (void *)buffer;
+	*initrd = (void *)(uintptr_t)buffer;
 	ret = load_file2_prot->load_file(load_file2_prot, dp, false,
 					 initrd_size, *initrd);
 	if (ret != EFI_SUCCESS) {
--
Quoted 2 lines

2.30.1