drm/amd/display: added NULL check at start of dc_validate_stream
authorjsg <jsg@openbsd.org>
Mon, 9 Sep 2024 09:53:32 +0000 (09:53 +0000)
committerjsg <jsg@openbsd.org>
Mon, 9 Sep 2024 09:53:32 +0000 (09:53 +0000)
From winstang
154a50bf4221a6a6ccf88d565b8184da7c40a2dd in linux-6.6.y/6.6.50
26c56049cc4f1705b498df013949427692a4b0d5 in mainline linux

sys/dev/pci/drm/amd/display/dc/core/dc_resource.c

index d0df360..a2f302d 100644 (file)
@@ -3927,6 +3927,9 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,
 
 enum dc_status dc_validate_stream(struct dc *dc, struct dc_stream_state *stream)
 {
+       if (dc == NULL || stream == NULL)
+               return DC_ERROR_UNEXPECTED;
+
        struct dc_link *link = stream->link;
        struct timing_generator *tg = dc->res_pool->timing_generators[0];
        enum dc_status res = DC_OK;