lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-c382986fe178d02abdfcd6f4e7b9783c2922872c@git.kernel.org>
Date:   Thu, 22 Nov 2018 02:15:39 -0800
From:   tip-bot for Yafang Shao <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     tglx@...utronix.de, linux-kernel@...r.kernel.org,
        dvlasenk@...hat.com, peterz@...radead.org, brgerst@...il.com,
        luto@...capital.net, hpa@...or.com, mingo@...nel.org,
        laoar.shao@...il.com, torvalds@...ux-foundation.org, bp@...en8.de
Subject: [tip:x86/cleanups] x86/process: Avoid unnecessary NULL check in
 get_wchan()

Commit-ID:  c382986fe178d02abdfcd6f4e7b9783c2922872c
Gitweb:     https://git.kernel.org/tip/c382986fe178d02abdfcd6f4e7b9783c2922872c
Author:     Yafang Shao <laoar.shao@...il.com>
AuthorDate: Wed, 21 Nov 2018 19:12:14 +0800
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 22 Nov 2018 10:07:21 +0100

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@...il.com>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/1542798734-12532-1-git-send-email-laoar.shao@gmail.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 8a33d4ad9661..b7cb5348f37f 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -733,7 +733,7 @@ unsigned long get_wchan(struct task_struct *p)
 	unsigned long start, bottom, top, sp, fp, ip, ret = 0;
 	int count = 0;
 
-	if (!p || p == current || p->state == TASK_RUNNING)
+	if (p == current || p->state == TASK_RUNNING)
 		return 0;
 
 	if (!try_get_task_stack(p))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ