summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2021-09-27 03:23:17 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2021-09-27 03:23:17 +0000
commit88d70d1d1fa7110cbb06897083f700ccc49e6899 (patch)
tree1039824ea5eaa003f0dbb78872a9abd214aaca3d /sys/dev/pci
parentc48d05f8e3d1bfd7077e59dda88eb290d07d446d (diff)
drm: avoid blocking in drm_clients_info's rcu section
From Desmond Cheong Zhi Xi 54e51d288b38377e8cd645a83e1ad08cc9d20ccc in linux 5.10.y/5.10.67 5eff9585de220cdd131237f5665db5e6c6bdf590 in mainline linux
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/drm_debugfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_debugfs.c b/sys/dev/pci/drm/drm_debugfs.c
index 4d36104fae3..0fb8b2bb8b4 100644
--- a/sys/dev/pci/drm/drm_debugfs.c
+++ b/sys/dev/pci/drm/drm_debugfs.c
@@ -91,6 +91,7 @@ static int drm_clients_info(struct seq_file *m, void *data)
mutex_lock(&dev->filelist_mutex);
list_for_each_entry_reverse(priv, &dev->filelist, lhead) {
struct task_struct *task;
+ bool is_current_master = drm_is_current_master(priv);
rcu_read_lock(); /* locks pid_task()->comm */
task = pid_task(priv->pid, PIDTYPE_PID);
@@ -99,7 +100,7 @@ static int drm_clients_info(struct seq_file *m, void *data)
task ? task->comm : "<unknown>",
pid_vnr(priv->pid),
priv->minor->index,
- drm_is_current_master(priv) ? 'y' : 'n',
+ is_current_master ? 'y' : 'n',
priv->authenticated ? 'y' : 'n',
from_kuid_munged(seq_user_ns(m), uid),
priv->magic);