From 059ed2c096209c598060242dc86206bc45087d80 Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 13 Jan 2023 01:52:52 +0000 Subject: [PATCH] drm/i915/gvt: fix gvt debugfs destroy From Zhenyu Wang fe340500baf84b6531c9fc508b167525b9bf6446 in linux-6.1.y/6.1.5 c4b850d1f448a901fbf4f7f36dec38c84009b489 in mainline linux --- sys/dev/pci/drm/i915/gvt/debugfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/drm/i915/gvt/debugfs.c b/sys/dev/pci/drm/i915/gvt/debugfs.c index 9f1c209d925..d7df27feee8 100644 --- a/sys/dev/pci/drm/i915/gvt/debugfs.c +++ b/sys/dev/pci/drm/i915/gvt/debugfs.c @@ -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; + } } -- 2.20.1