All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: take size of pointed value, not pointer
@ 2022-05-24  2:50 Haowen Bai
  2022-05-24  3:06 ` Huacai Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Haowen Bai @ 2022-05-24  2:50 UTC (permalink / raw)
  To: Ard Biesheuvel, Huacai Chen; +Cc: Haowen Bai, linux-efi, linux-kernel

Sizeof a pointer-typed expression returns the size of the pointer, not
that of the pointed data.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
 arch/loongarch/kernel/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/kernel/efi.c b/arch/loongarch/kernel/efi.c
index f9fdeb1ae358..f0e5d0feffc2 100644
--- a/arch/loongarch/kernel/efi.c
+++ b/arch/loongarch/kernel/efi.c
@@ -180,7 +180,7 @@ void __init efi_init(void)
 	if (!efi_system_table)
 		return;
 
-	efi_systab = (efi_system_table_t *)early_memremap_ro(efi_system_table, sizeof(efi_systab));
+	efi_systab = (efi_system_table_t *)early_memremap_ro(efi_system_table, sizeof(*efi_systab));
 	if (!efi_systab) {
 		pr_err("Can't find EFI system table.\n");
 		return;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-24 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24  2:50 [PATCH] LoongArch: take size of pointed value, not pointer Haowen Bai
2022-05-24  3:06 ` Huacai Chen
2022-05-24  4:03   ` Huacai Chen
2022-05-24 11:40     ` Huacai Chen
2022-05-24 12:11       ` Ard Biesheuvel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.