aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristian Brauner <christian@brauner.io>2019-06-27 09:35:14 (GMT)
committerChristian Brauner <christian@brauner.io>2019-06-27 10:25:09 (GMT)
commit30d158b143b6575261ab610ae7b1b4f7fe3830b3 (patch)
tree44f0182587378129a8e68e414b3d644012369cd0 /fs
parent6fd2fe494b17bf2dec37b610d23a43a72b16923a (diff)
downloadkernel_replicant_linux-30d158b143b6575261ab610ae7b1b4f7fe3830b3.zip
kernel_replicant_linux-30d158b143b6575261ab610ae7b1b4f7fe3830b3.tar.gz
kernel_replicant_linux-30d158b143b6575261ab610ae7b1b4f7fe3830b3.tar.bz2
proc: remove useless d_is_dir() check
Remove the d_is_dir() check from tgid_pidfd_to_pid(). It is pointless since you should never get &proc_tgid_base_operations for f_op on a non-directory. Suggested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Christian Brauner <christian@brauner.io>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/base.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 9c8ca6c..255f675 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -3077,8 +3077,7 @@ static const struct file_operations proc_tgid_base_operations = {
struct pid *tgid_pidfd_to_pid(const struct file *file)
{
- if (!d_is_dir(file->f_path.dentry) ||
- (file->f_op != &proc_tgid_base_operations))
+ if (file->f_op != &proc_tgid_base_operations)
return ERR_PTR(-EBADF);
return proc_pid(file_inode(file));