Commit 30d158b1 authored by Christian Brauner's avatar Christian Brauner

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarChristian Brauner <christian@brauner.io>
parent 6fd2fe49
...@@ -3077,8 +3077,7 @@ static const struct file_operations proc_tgid_base_operations = { ...@@ -3077,8 +3077,7 @@ static const struct file_operations proc_tgid_base_operations = {
struct pid *tgid_pidfd_to_pid(const struct file *file) struct pid *tgid_pidfd_to_pid(const struct file *file)
{ {
if (!d_is_dir(file->f_path.dentry) || if (file->f_op != &proc_tgid_base_operations)
(file->f_op != &proc_tgid_base_operations))
return ERR_PTR(-EBADF); return ERR_PTR(-EBADF);
return proc_pid(file_inode(file)); return proc_pid(file_inode(file));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment