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

Michael Ellerman mpe at ellerman.id.au
Sat Feb 23 22:31:18 AEDT 2019


Michael Ellerman <mpe at ellerman.id.au> writes:
> 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


More information about the Linuxppc-dev mailing list