[PATCH 2/2] ARM: Return directly after a failed kmalloc() in init_atags_procfs()

Markus Elfring Markus.Elfring at web.de
Tue Mar 28 10:17:30 PDT 2023


Date: Tue, 28 Mar 2023 18:56:31 +0200

Return directly after a call of the function “kmalloc” failed
at the beginning.

Signed-off-by: Markus Elfring <elfring at users.sourceforge.net>
---
 arch/arm/kernel/atags_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/atags_proc.c b/arch/arm/kernel/atags_proc.c
index 2f08ab08e68f..1c7441f3af85 100644
--- a/arch/arm/kernel/atags_proc.c
+++ b/arch/arm/kernel/atags_proc.c
@@ -56,7 +56,7 @@ static int __init init_atags_procfs(void)

 	b = kmalloc(sizeof(*b) + size, GFP_KERNEL);
 	if (!b)
-		goto nomem;
+		return -ENOMEM;

 	b->size = size;
 	memcpy(b->data, atags_copy, size);
--
2.40.0




More information about the linux-arm-kernel mailing list