From: "tip-bot2 for Thorsten Blum" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
Dave Hansen <dave.hansen@linux.intel.com>,
Jarkko Sakkinen <jarkko@kernel.org>,
Kai Huang <kai.huang@intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/sgx] x86/sgx: Use vmalloc_array() instead of vmalloc()
Date: Tue, 12 Nov 2024 19:27:12 -0000 [thread overview]
Message-ID: <173143963304.32228.265321628400891478.tip-bot2@tip-bot2> (raw)
The following commit has been merged into the x86/sgx branch of tip:
Commit-ID: f060c89dc1a3cfb6db3894e1d96980a568aa355c
Gitweb: https://git.kernel.org/tip/f060c89dc1a3cfb6db3894e1d96980a568aa355c
Author: Thorsten Blum <thorsten.blum@linux.dev>
AuthorDate: Tue, 12 Nov 2024 19:26:34 +01:00
Committer: Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Tue, 12 Nov 2024 11:11:42 -08:00
x86/sgx: Use vmalloc_array() instead of vmalloc()
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index 9ace844..1a59e59 100644
--- 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;
reply other threads:[~2024-11-12 19:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=173143963304.32228.265321628400891478.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=dave.hansen@linux.intel.com \
--cc=jarkko@kernel.org \
--cc=kai.huang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=thorsten.blum@linux.dev \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®