From: jsg Date: Fri, 13 Jan 2023 01:54:11 +0000 (+0000) Subject: drm/i915/gvt: fix vgpu debugfs clean in remove X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b6d020927fca3591009112efb1281edb0433c568;p=openbsd drm/i915/gvt: fix vgpu debugfs clean in remove From Zhenyu Wang 44c0e07e3972e3f2609d69ad873d4f342f8a68ec in linux-6.1.y/6.1.5 704f3384f322b40ba24d958473edfb1c9750c8fd in mainline linux --- diff --git a/sys/dev/pci/drm/i915/gvt/debugfs.c b/sys/dev/pci/drm/i915/gvt/debugfs.c index d7df27feee8..e08ed0e9f16 100644 --- a/sys/dev/pci/drm/i915/gvt/debugfs.c +++ b/sys/dev/pci/drm/i915/gvt/debugfs.c @@ -175,8 +175,13 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu) */ void intel_gvt_debugfs_remove_vgpu(struct intel_vgpu *vgpu) { - debugfs_remove_recursive(vgpu->debugfs); - vgpu->debugfs = NULL; + struct intel_gvt *gvt = vgpu->gvt; + struct drm_minor *minor = gvt->gt->i915->drm.primary; + + if (minor->debugfs_root && gvt->debugfs_root) { + debugfs_remove_recursive(vgpu->debugfs); + vgpu->debugfs = NULL; + } } /**