From: Nicolai Stange <nicstange@gmail.com>
To: Daniel Vetter <daniel.vetter@intel.com>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Michel Dänzer" <michel@daenzer.net>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
"Nicolai Stange" <nicstange@gmail.com>
Subject: [PATCH] drm/amdgpu: don't add files at control minor debugfs directory
Date: Mon, 5 Dec 2016 21:30:22 +0100 [thread overview]
Message-ID: <20161205203022.11671-1-nicstange@gmail.com> (raw)
In-Reply-To: <b6b5b320-fd07-b096-8287-d8eae0163b02@amd.com>
Since commit 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"), a
struct drm_device's ->control member is always NULL.
In the case of CONFIG_DEBUG_FS=y, amdgpu_debugfs_add_files() accesses
->control->debugfs_root though. This results in a NULL pointer
dereference.
Fix this by omitting the drm_debugfs_create_files() call for the
control minor debugfs directory which is now non-existent anyway.
Fixes: 8a357d10043c ("drm: Nerf DRM_CONTROL nodes")
Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
Applicable to next-20161202. Compile-only tested.
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index deee2db..0cb3e82 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2493,9 +2493,6 @@ int amdgpu_debugfs_add_files(struct amdgpu_device *adev,
adev->debugfs_count = i;
#if defined(CONFIG_DEBUG_FS)
drm_debugfs_create_files(files, nfiles,
- adev->ddev->control->debugfs_root,
- adev->ddev->control);
- drm_debugfs_create_files(files, nfiles,
adev->ddev->primary->debugfs_root,
adev->ddev->primary);
#endif
@@ -2510,9 +2507,6 @@ static void amdgpu_debugfs_remove_files(struct amdgpu_device *adev)
for (i = 0; i < adev->debugfs_count; i++) {
drm_debugfs_remove_files(adev->debugfs[i].files,
adev->debugfs[i].num_files,
- adev->ddev->control);
- drm_debugfs_remove_files(adev->debugfs[i].files,
- adev->debugfs[i].num_files,
adev->ddev->primary);
}
#endif
--
2.10.2
next prev parent reply other threads:[~2016-12-05 20:30 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-03 14:47 [PATCH] drm/radeon: don't add files at control minor debugfs directory Nicolai Stange
2016-12-05 7:27 ` Daniel Vetter
2016-12-05 7:27 ` Daniel Vetter
2016-12-05 7:42 ` Christian König
2016-12-05 7:42 ` Christian König
2016-12-05 8:04 ` Daniel Vetter
2016-12-05 8:04 ` Daniel Vetter
2016-12-05 8:39 ` Nicolai Stange
2016-12-05 8:39 ` Nicolai Stange
2016-12-05 8:48 ` Christian König
2016-12-05 8:48 ` Christian König
2016-12-05 9:11 ` Michel Dänzer
2016-12-05 9:11 ` Michel Dänzer
2016-12-05 9:51 ` Daniel Vetter
2016-12-05 9:51 ` Daniel Vetter
2016-12-05 20:30 ` Nicolai Stange [this message]
2016-12-05 20:33 ` [PATCH] drm/amdgpu: " Deucher, Alexander
2016-12-05 20:33 ` Deucher, Alexander
2016-12-06 2:01 ` Mike Lothian
2016-12-06 7:17 ` Daniel Vetter
2016-12-06 7:17 ` Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2016-12-05 20:07 Alex Deucher
[not found] ` <1480968458-2270-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-12-06 1:00 ` Michel Dänzer
[not found] ` <8a8380a1-fb41-e4e9-8c30-7ea075a241ac-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-12-06 7:59 ` Christian König
[not found] ` <65ba1d07-7c50-c0d8-4d1b-bcdc7d447a63-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-12-08 9:52 ` Shawn Starr
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=20161205203022.11671-1-nicstange@gmail.com \
--to=nicstange@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michel@daenzer.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.