diff mbox series

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

Message ID 7dce2d53-9066-e26d-9e4f-e923226611d8@web.de (mailing list archive)
State New, archived
Headers show
Series ARM: Adjustments for init_atags_procfs() | expand

Commit Message

Markus Elfring March 28, 2023, 5:17 p.m. UTC
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@users.sourceforge.net>
---
 arch/arm/kernel/atags_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.40.0
diff mbox series

Patch

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);