From: Karl Mehltretter <kmehltretter@gmail.com>
To: Jarkko Sakkinen <jarkko@kernel.org>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
x86@kernel.org
Cc: Karl Mehltretter <kmehltretter@gmail.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>, Kai Huang <kai.huang@intel.com>,
linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] x86/sgx: Fix the return value in __sgx_alloc_epc_page() kernel-doc
Date: Sat, 12 Sep 2026 00:04:42 +0200 [thread overview]
Message-ID: <20260911220442.6815-1-kmehltretter@gmail.com> (raw)
__sgx_alloc_epc_page() returns ERR_PTR(-ENOMEM) when no EPC page is
available, but its kernel-doc says that this case returns NULL. Document
the error pointer returned when the node search is exhausted.
Fixes: 901ddbb9ecf5 ("x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
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 4505f808af5e5f248d89f47006fcd38de3968cf3..f6b24f362e4155a5bf4d27a84622a1cf03c6320c 100644
--- a/arch/x86/kernel/cpu/sgx/main.c
+++ b/arch/x86/kernel/cpu/sgx/main.c
@@ -475,7 +475,7 @@ static struct sgx_epc_page *__sgx_alloc_epc_page_from_node(int nid)
*
* Return:
* - an EPC page: A borrowed EPC pages were available.
- * - NULL: Out of EPC pages.
+ * - ERR_PTR(-ENOMEM): Out of EPC pages.
*/
struct sgx_epc_page *__sgx_alloc_epc_page(void)
{
reply other threads:[~2026-09-11 22:06 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=20260911220442.6815-1-kmehltretter@gmail.com \
--to=kmehltretter@gmail.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jarkko@kernel.org \
--cc=kai.huang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sgx@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@kernel.org \
--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®