@@ -16,6 +16,9 @@ void drm_clients_close(struct drm_file *file_priv)
lockdep_assert_held(&dev->filelist_mutex);
+ if (!dev->driver->cg_ops)
+ return;
+
clients = xa_load(&drm_pid_clients, pid);
list_del_rcu(&file_priv->clink);
if (atomic_dec_and_test(&clients->num)) {
@@ -40,6 +43,9 @@ int drm_clients_open(struct drm_file *file_priv)
lockdep_assert_held(&dev->filelist_mutex);
+ if (!dev->driver->cg_ops)
+ return 0;
+
clients = xa_load(&drm_pid_clients, pid);
if (!clients) {
clients = kmalloc(sizeof(*clients), GFP_KERNEL);