Skip to content

Commit 154a50b

Browse files
winstanggregkh
authored andcommitted
drm/amd/display: added NULL check at start of dc_validate_stream
[ Upstream commit 26c5604 ] [Why] prevent invalid memory access [How] check if dc and stream are NULL Co-authored-by: winstang <winstang@amd.com> Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Acked-by: Zaeem Mohamed <zaeem.mohamed@amd.com> Signed-off-by: winstang <winstang@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent da696cb commit 154a50b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3927,6 +3927,9 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,
39273927

39283928
enum dc_status dc_validate_stream(struct dc *dc, struct dc_stream_state *stream)
39293929
{
3930+
if (dc == NULL || stream == NULL)
3931+
return DC_ERROR_UNEXPECTED;
3932+
39303933
struct dc_link *link = stream->link;
39313934
struct timing_generator *tg = dc->res_pool->timing_generators[0];
39323935
enum dc_status res = DC_OK;

0 commit comments

Comments
 (0)