[PATCH 4/5] drm/armada: check dri/crtc root before debugfs init
Nirmoy Das
nirmoy.das at amd.com
Fri Oct 8 09:17:03 UTC 2021
Return early if dri minor root dentry is NULL.
CC: Russell King <linux at armlinux.org.uk>
CC: David Airlie <airlied at linux.ie>
CC: Daniel Vetter <daniel at ffwll.ch>
Signed-off-by: Nirmoy Das <nirmoy.das at amd.com>
---
drivers/gpu/drm/armada/armada_debugfs.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c
index 29f4b52e3c8d..b40003fe4a89 100644
--- a/drivers/gpu/drm/armada/armada_debugfs.c
+++ b/drivers/gpu/drm/armada/armada_debugfs.c
@@ -93,6 +93,9 @@ static const struct file_operations armada_debugfs_crtc_reg_fops = {
void armada_drm_crtc_debugfs_init(struct armada_crtc *dcrtc)
{
+ if (!dcrtc->crtc.debugfs_entry)
+ return;
+
debugfs_create_file("armada-regs", 0600, dcrtc->crtc.debugfs_entry,
dcrtc, &armada_debugfs_crtc_reg_fops);
}
@@ -104,6 +107,9 @@ static struct drm_info_list armada_debugfs_list[] = {
int armada_drm_debugfs_init(struct drm_minor *minor)
{
+ if (!minor->debugfs_root)
+ return;
+
drm_debugfs_create_files(armada_debugfs_list, ARMADA_DEBUGFS_ENTRIES,
minor->debugfs_root, minor);
--
2.32.0
More information about the dri-devel
mailing list