lkml.org 
[lkml]   [2022]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] mm: remove unnecessary check in alloc_thread_stack_node()
The "stack" pointer cannot be NULL at this point so there is no
need to check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
kernel/fork.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 516f9db66640..5e7ca394b8e3 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -327,8 +327,7 @@ static int alloc_thread_stack_node(struct task_struct *tsk, int node)
* so cache the vm_struct.
*/
tsk->stack_vm_area = vm;
- if (stack)
- stack = kasan_reset_tag(stack);
+ stack = kasan_reset_tag(stack);
tsk->stack = stack;
return 0;
}
--
2.20.1
\
 
 \ /
  Last update: 2022-03-01 09:08    [W:0.039 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site