Thread (34 messages) 34 messages, 4 authors, 2019-02-26

Re: [PATCH v16 05/21] powerpc: prep stack walkers for THREAD_INFO_IN_TASK

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2019-02-23 11:33:03

Michael Ellerman [off-list ref] writes:
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index ce393df243aa..4ffbb677c9f5 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -2067,6 +2081,9 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
 	int curr_frame = 0;
 #endif
 
+	if (!try_get_task_stack(tsk))
+		return;
This needs to be after the NULL check below:
 	sp = (unsigned long) stack;
 	if (tsk == NULL)
 		tsk = current;

Otherwise show_stack(NULL, NULL) blows up :)

I've changed it to:

	if (tsk == NULL)
		tsk = current;

	if (!try_get_task_stack(tsk))
		return;

	sp = (unsigned long) stack;
	if (sp == 0) {
        	...


cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help