diff options
| author | Yafang Shao <laoar.shao@gmail.com> | 2018-11-21 06:12:14 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-11-23 01:58:23 -0500 |
| commit | 6e662ae7bce6db602f79e57791f5fb887fb7d371 (patch) | |
| tree | b44e95083122c4cac2d6665e7eb1804843068c36 /arch | |
| parent | 8e1599fcac2efda8b7d433ef69d2492f0b351e3f (diff) | |
x86/process: Avoid unnecessary NULL check in get_wchan()
Task 'p' is always guaranteed to be non-NULL, because the only call
sites are in fs/proc/ which all guarantee a non-NULL task pointer.
[ mingo: Improved the changelog. ]
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1542798734-12532-1-git-send-email-laoar.shao@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86/kernel/process.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index c93fcfdf1673..3c3ee8982577 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
| @@ -730,7 +730,7 @@ unsigned long get_wchan(struct task_struct *p) | |||
| 730 | unsigned long start, bottom, top, sp, fp, ip, ret = 0; | 730 | unsigned long start, bottom, top, sp, fp, ip, ret = 0; |
| 731 | int count = 0; | 731 | int count = 0; |
| 732 | 732 | ||
| 733 | if (!p || p == current || p->state == TASK_RUNNING) | 733 | if (p == current || p->state == TASK_RUNNING) |
| 734 | return 0; | 734 | return 0; |
| 735 | 735 | ||
| 736 | if (!try_get_task_stack(p)) | 736 | if (!try_get_task_stack(p)) |
