提交 afdbd4cc 编写于 作者: J Jerry Zuo 提交者: Alex Deucher

drm/amd/display: fix NULL pointer in dm_commit_surfaces

Check if adding surface is failed to prevent NULL pointer deref.
Signed-off-by: NJerry Zuo <Jerry.Zuo@amd.com>
Reviewed-by: NHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 ece22899
...@@ -2411,6 +2411,10 @@ static void amdgpu_dm_commit_surfaces(struct drm_atomic_state *state, ...@@ -2411,6 +2411,10 @@ static void amdgpu_dm_commit_surfaces(struct drm_atomic_state *state,
if (crtc == pcrtc) { if (crtc == pcrtc) {
add_surface(dm->dc, crtc, plane, add_surface(dm->dc, crtc, plane,
&dc_surfaces_constructed[planes_count]); &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; dc_stream_attach = acrtc_attach->stream;
planes_count++; planes_count++;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册