]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/signal.c
Merge tag 'dma-mapping-5.4-2' of git://git.infradead.org/users/hch/dma-mapping
[linux.git] / kernel / signal.c
index 534fec266a334b299846034e878c271619fe5c71..c4da1ef56fdfcd7a522e403600c9786efc26bd94 100644 (file)
@@ -3678,8 +3678,11 @@ static int copy_siginfo_from_user_any(kernel_siginfo_t *kinfo, siginfo_t *info)
 
 static struct pid *pidfd_to_pid(const struct file *file)
 {
-       if (file->f_op == &pidfd_fops)
-               return file->private_data;
+       struct pid *pid;
+
+       pid = pidfd_pid(file);
+       if (!IS_ERR(pid))
+               return pid;
 
        return tgid_pidfd_to_pid(file);
 }