drm/i915/gvt: fix gvt debugfs destroy
authorjsg <jsg@openbsd.org>
Fri, 13 Jan 2023 01:52:52 +0000 (01:52 +0000)
committerjsg <jsg@openbsd.org>
Fri, 13 Jan 2023 01:52:52 +0000 (01:52 +0000)
From Zhenyu Wang
fe340500baf84b6531c9fc508b167525b9bf6446 in linux-6.1.y/6.1.5
c4b850d1f448a901fbf4f7f36dec38c84009b489 in mainline linux

sys/dev/pci/drm/i915/gvt/debugfs.c

index 9f1c209..d7df27f 100644 (file)
@@ -199,6 +199,10 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt)
  */
 void intel_gvt_debugfs_clean(struct intel_gvt *gvt)
 {
-       debugfs_remove_recursive(gvt->debugfs_root);
-       gvt->debugfs_root = NULL;
+       struct drm_minor *minor = gvt->gt->i915->drm.primary;
+
+       if (minor->debugfs_root) {
+               debugfs_remove_recursive(gvt->debugfs_root);
+               gvt->debugfs_root = NULL;
+       }
 }