public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: remove unnecessary check in alloc_thread_stack_node()
@ 2022-03-01  8:07 Dan Carpenter
  2022-03-01  8:26 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2022-03-01  8:07 UTC (permalink / raw)
  To: Eric W. Biederman, Andrey Konovalov
  Cc: Andrew Morton, Thomas Gleixner, Peter Zijlstra, Andy Lutomirski,
	Sebastian Andrzej Siewior, Alexey Gladkov, Liam R. Howlett,
	Jens Axboe, David Hildenbrand, linux-kernel, kernel-janitors

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-01  8:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-01  8:07 [PATCH] mm: remove unnecessary check in alloc_thread_stack_node() Dan Carpenter
2022-03-01  8:26 ` Sebastian Andrzej Siewior
2022-03-01  8:45   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox