drm/amd/display: fix NULL pointer dereference.
Subsystems (3)
PATCH 1/1 drm/amd/display: fix NULL pointer dereference.
on vega10, driver can run into a NULL-pointer dereference.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -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;
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1491378913-20768-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
The issue seems already fixed by the following commit {{{
commit 52184bbf4773512d7c83fe21a0b4b4ec4be27caf
Author: Jordan Lazare <[email protected]> Date: Wed Apr 5 15:05:51 2017 -0400
drm/amd/display: fix nullptr on vega initialization
}}}
Regards,
Evan
Quoted 34 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Rex Zhu
Sent: Wednesday, April 05, 2017 3:55 PM
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH] drm/amd/display: fix NULL pointer dereference.on vega10, driver can run into a NULL-pointer dereference.
Change-Id I8e2de5343f804d6e736f620ff6d3d6e6488fb970Signed-off-by Rex Zhu <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1@@ -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;
Quoted 7 lines
--
1.9.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Zhang, Jerry
Reviewed-by Junwei ZhangQuoted 22 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Rex Zhu
Sent: Wednesday, April 05, 2017 15:55
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH] drm/amd/display: fix NULL pointer dereference.on vega10, driver can run into a NULL-pointer dereference.
Change-Id I8e2de5343f804d6e736f620ff6d3d6e6488fb970Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c int amdgpu_dm_initialize_drm_device(struct · line 1099
Quoted 6 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-1@@ -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 )
We can simplify it like:
if (mode_info->plane_type)
With that fix,
Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0+ mode_info->planes[i]->plane_type = mode_info- >plane_type[i];if (amdgpu_dm_plane_init (dm, mode_info->planes[i],1 )) {drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-1DRM_ERROR ("KMS: Failed to initialize plane\n" ); goto fail_free_planes; --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx