@@ -35,6 +35,9 @@ void drm_clients_close(struct drm_file *file_priv)
lockdep_assert_held(&dev->filelist_mutex);
+ if (!dev->driver->cg_ops)
+ return;
+
pid = rcu_access_pointer(file_priv->pid);
clients = xa_load(&drm_pid_clients, (unsigned long)pid);
if (WARN_ON_ONCE(!clients))
@@ -66,6 +69,9 @@ int drm_clients_open(struct drm_file *file_priv)
lockdep_assert_held(&dev->filelist_mutex);
+ if (!dev->driver->cg_ops)
+ return 0;
+
pid = (unsigned long)rcu_access_pointer(file_priv->pid);
clients = xa_load(&drm_pid_clients, pid);
if (!clients) {
@@ -101,6 +107,9 @@ drm_clients_migrate(struct drm_file *file_priv,
lockdep_assert_held(&dev->filelist_mutex);
+ if (!dev->driver->cg_ops)
+ return;
+
existing_clients = xa_load(&drm_pid_clients, new);
clients = xa_load(&drm_pid_clients, old);