[PATCH] x86/sgx: Fix the return value in __sgx_alloc_epc_page() kernel-doc

Karl Mehltretter posted 1 patch 1 week, 6 days ago
arch/x86/kernel/cpu/sgx/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] x86/sgx: Fix the return value in __sgx_alloc_epc_page() kernel-doc
Posted by Karl Mehltretter 1 week, 6 days ago
__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)
 {