[PATCH 2/5] drm/i915: check dri root before debugfs init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Return early if dri minor root dentry is NULL.

CC: Zhenyu Wang <zhenyuw@xxxxxxxxxxxxxxx>
CC: Zhi Wang <zhi.a.wang@xxxxxxxxx>
CC: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
CC: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
CC: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
CC: David Airlie <airlied@xxxxxxxx>
CC: Daniel Vetter <daniel@xxxxxxxx>
Signed-off-by: Nirmoy Das <nirmoy.das@xxxxxxx>
---
 drivers/gpu/drm/i915/gvt/debugfs.c  | 3 +++
 drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c
index 9f1c209d9251..2d47acaa03ee 100644
--- a/drivers/gpu/drm/i915/gvt/debugfs.c
+++ b/drivers/gpu/drm/i915/gvt/debugfs.c
@@ -187,6 +187,9 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt)
 {
 	struct drm_minor *minor = gvt->gt->i915->drm.primary;

+	if (!minor->debugfs_root)
+		return;
+
 	gvt->debugfs_root = debugfs_create_dir("gvt", minor->debugfs_root);

 	debugfs_create_ulong("num_tracked_mmio", 0444, gvt->debugfs_root,
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 44969f5dde50..d572b686edeb 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1012,6 +1012,9 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv)
 	struct drm_minor *minor = dev_priv->drm.primary;
 	int i;

+	if (!minor->debugfs_root)
+		return;
+
 	i915_debugfs_params(dev_priv);

 	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
--
2.32.0




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux