Hi Zhi,
Please discard this patch, review
https://patchwork.freedesktop.org/patch/458554/?series=95690&rev=1 instead.
minor->debugfs_root wont be NULl as we save debugfs_create_dir()'s return value in that.
Regards,
Nirmoy
On 10/12/2021 11:59 AM, Wang, Zhi A wrote:
On 10/8/21 9:17 AM, Nirmoy Das wrote:
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
Thanks for the patch. queued.
Reviewed-by: Zhi Wang <zhi.a.wang@xxxxxxxxx>