[PATCH] drm/amd/display: fix NULL pointer dereference.
Rex Zhu
Rex.Zhu at amd.com
Wed Apr 5 07:55:13 UTC 2017
on vega10, driver can run into a NULL-pointer dereference.
Change-Id: I8e2de5343f804d6e736f620ff6d3d6e6488fb970
Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 62be159..8f5951f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1095,7 +1095,8 @@ int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
DRM_ERROR("KMS: Failed to allocate surface\n");
goto fail_free_planes;
}
- mode_info->planes[i]->plane_type = mode_info->plane_type[i];
+ if (mode_info->plane_type != NULL)
+ mode_info->planes[i]->plane_type = mode_info->plane_type[i];
if (amdgpu_dm_plane_init(dm, mode_info->planes[i], 1)) {
DRM_ERROR("KMS: Failed to initialize plane\n");
goto fail_free_planes;
--
1.9.1
More information about the amd-gfx
mailing list