Skip to contentSkip to conversation

x86/process: directly use try_get_task_stack() return value in get_wchan

PATCH Superseded Jisheng Zhang 1 participant 1 message Aug 3, 2021 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/process: directly use try_get_task_stack() return value in get_wchan

try_get_task_stack() has already properly gets target task's stack, no need to call task_stack_page() again.

---
 arch/x86/kernel/process.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
arch/x86/kernel/process.c +2 -5
index 1d9463e3096b..d4a6503b3878 100644
@@ -950,12 +950,9 @@ unsigned long get_wchan(struct task_struct *p)
 	if (p == current || task_is_running(p))
 		return 0;
 
-	if (!try_get_task_stack(p))
-		return 0;
-
-	start = (unsigned long)task_stack_page(p);
+	start = (unsigned long)try_get_task_stack(p);
 	if (!start)
-		goto out;
+		return 0;
 
 	/*
 	 * Layout of the stack page:
Signature · 1 line
2.32.0