Skip to content

Commit

Permalink
proc: remove useless d_is_dir() check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Brauner committed Jun 27, 2019
1 parent 6fd2fe4 commit 30d158b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 30d158b

Please sign in to comment.