mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-20 15:27:52 +07:00
drm/amd/display: fix NULL pointer in dm_commit_surfaces
Check if adding surface is failed to prevent NULL pointer deref. Signed-off-by: Jerry Zuo <Jerry.Zuo@amd.com> Reviewed-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
ece22899a4
commit
afdbd4ccfd
@ -2411,6 +2411,10 @@ static void amdgpu_dm_commit_surfaces(struct drm_atomic_state *state,
|
||||
if (crtc == pcrtc) {
|
||||
add_surface(dm->dc, crtc, plane,
|
||||
&dc_surfaces_constructed[planes_count]);
|
||||
if (dc_surfaces_constructed[planes_count] == NULL) {
|
||||
dm_error("%s: Failed to add surface!\n", __func__);
|
||||
continue;
|
||||
}
|
||||
dc_stream_attach = acrtc_attach->stream;
|
||||
planes_count++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user