提交 ea3f6dcf 编写于 作者: I Ilya Leoshkevich 提交者: Vasily Gorbik

s390/unwind: fix get_stack_pointer(NULL, NULL)

unwind_for_each_frame(NULL, NULL, 0) does not return any valid frames.

The reason is that get_stack_pointer, unlike get_stack_info and
show_stack, does not handle NULL argument.

Fix by making get_stack_pointer treat NULL as current, like
get_stack_info and show_stack do.
Reviewed-by: NVasily Gorbik <gor@linux.ibm.com>
Tested-by: NVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: NIlya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
上级 d3baaeb5
...@@ -38,7 +38,7 @@ static inline unsigned long get_stack_pointer(struct task_struct *task, ...@@ -38,7 +38,7 @@ static inline unsigned long get_stack_pointer(struct task_struct *task,
{ {
if (regs) if (regs)
return (unsigned long) kernel_stack_pointer(regs); return (unsigned long) kernel_stack_pointer(regs);
if (task == current) if (!task || task == current)
return current_stack_pointer(); return current_stack_pointer();
return (unsigned long) task->thread.ksp; return (unsigned long) task->thread.ksp;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册