dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@amd.com>
To: <dri-devel@lists.freedesktop.org>
Cc: <intel-gfx@lists.freedesktop.org>,
	Nirmoy Das <nirmoy.das@amd.com>,
	"Zhenyu Wang" <zhenyuw@linux.intel.com>,
	Zhi Wang <zhi.a.wang@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Subject: [PATCH 2/5] drm/i915: check dri root before debugfs init
Date: Fri, 8 Oct 2021 11:17:01 +0200	[thread overview]
Message-ID: <20211008091704.27094-2-nirmoy.das@amd.com> (raw)
In-Reply-To: <20211008091704.27094-1-nirmoy.das@amd.com>

Return early if dri minor root dentry is NULL.

CC: Zhenyu Wang <zhenyuw@linux.intel.com>
CC: Zhi Wang <zhi.a.wang@intel.com>
CC: Jani Nikula <jani.nikula@linux.intel.com>
CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
CC: Rodrigo Vivi <rodrigo.vivi@intel.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 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


  reply	other threads:[~2021-10-08  9:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08  9:17 [PATCH 1/5] dri: cleanup debugfs error handling Nirmoy Das
2021-10-08  9:17 ` Nirmoy Das [this message]
2021-10-12  9:59   ` [PATCH 2/5] drm/i915: check dri root before debugfs init Wang, Zhi A
2021-10-12 10:19     ` Das, Nirmoy
2021-10-08  9:17 ` [PATCH 3/5] drm/radeon: " Nirmoy Das
2021-10-08 10:23   ` Christian König
2021-10-08 10:34     ` Das, Nirmoy
2021-10-08  9:17 ` [PATCH 4/5] drm/armada: check dri/crtc " Nirmoy Das
2021-10-12 19:40   ` kernel test robot
2021-10-08  9:17 ` [PATCH 5/5] drm/tegra: check root dentry " Nirmoy Das
2021-11-08  6:35   ` kernel test robot
2021-10-08  9:35 ` [PATCH 1/5] dri: cleanup debugfs error handling Thomas Zimmermann
2021-10-08  9:40 ` [Intel-gfx] " Jani Nikula
2021-10-08 11:07   ` Greg KH
2021-10-08 12:08     ` Das, Nirmoy
     [not found]     ` <02fc9da3-ebac-2df1-3a54-d764b273f91b@amd.com>
2021-10-08 12:56       ` Fw: " Das, Nirmoy
     [not found]         ` <c4f1464d-19b6-04a3-e2d8-a153bfbb050a@amd.com>
     [not found]           ` <YWBfvILqkBQ8VSYc@kroah.com>
2021-10-11 14:19             ` Christian König
2021-10-11 14:53               ` Greg KH
2021-10-11 16:38                 ` Jani Nikula
2021-10-11 17:07                   ` Greg KH
2021-10-11 18:43                     ` Jani Nikula
2021-10-11 15:13               ` Das, Nirmoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211008091704.27094-2-nirmoy.das@amd.com \
    --to=nirmoy.das@amd.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=zhenyuw@linux.intel.com \
    --cc=zhi.a.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox