]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: don't add files at control minor debugfs directory
authorNicolai Stange <nicstange@gmail.com>
Mon, 5 Dec 2016 20:30:22 +0000 (21:30 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 6 Dec 2016 09:03:28 +0000 (10:03 +0100)
commit1b39b1ead6e233f32ea5f6d44f92808843e8e2e0
tree26ce677968f1ba7992ff276e2d18199bafff5fdd
parentc5b4eba213d8b9dff7780d80ef493a29c1a60509
drm/amdgpu: don't add files at control minor debugfs directory

Since commit 9efd62a44c19 ("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: 9efd62a44c19 ("drm: Nerf DRM_CONTROL nodes")
Signed-off-by: Nicolai Stange <nicstange@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98915
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161205203022.11671-1-nicstange@gmail.com
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c