From: Yu Liao liaoyu15@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAU9N4 CVE: CVE-2024-46802
--------------------------------
The previous commit introduce a compile warning: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c: In function ‘dc_validate_stream’: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:2920:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] struct dc_link *link = stream->link; ^~~~~~
Fix this by moving those declarations before code.
Fixes: d61f7961de27 ("drm/amd/display: added NULL check at start of dc_validate_stream") Signed-off-by: Yu Liao liaoyu15@huawei.com --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 6a993cdb101e..233edabc97d4 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -2914,12 +2914,15 @@ 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) { + struct dc_link *link; + struct timing_generator *tg; + enum dc_status res = DC_OK; + 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; + link = stream->link; + tg = dc->res_pool->timing_generators[0];
calculate_phy_pix_clks(stream);