projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2d5404c
)
x86/sgx: Use vmalloc_array() instead of vmalloc()
author
Thorsten Blum
<thorsten.blum@linux.dev>
Tue, 12 Nov 2024 18:26:34 +0000
(19:26 +0100)
committer
Dave Hansen
<dave.hansen@linux.intel.com>
Tue, 12 Nov 2024 19:11:42 +0000
(11:11 -0800)
Use vmalloc_array() instead of vmalloc() to calculate the number of
bytes to allocate.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Kai Huang <kai.huang@intel.com>
Link:
https://lore.kernel.org/all/20241112182633.172944-2-thorsten.blum%40linux.dev
arch/x86/kernel/cpu/sgx/main.c
patch
|
blob
|
history
diff --git
a/arch/x86/kernel/cpu/sgx/main.c
b/arch/x86/kernel/cpu/sgx/main.c
index
9ace844
..
1a59e59
100644
(file)
--- a/
arch/x86/kernel/cpu/sgx/main.c
+++ b/
arch/x86/kernel/cpu/sgx/main.c
@@
-630,7
+630,7
@@
static bool __init sgx_setup_epc_section(u64 phys_addr, u64 size,
if (!section->virt_addr)
return false;
- section->pages = vmalloc
(nr_pages *
sizeof(struct sgx_epc_page));
+ section->pages = vmalloc
_array(nr_pages,
sizeof(struct sgx_epc_page));
if (!section->pages) {
memunmap(section->virt_addr);
return false;