drm/amd/display: Fix late derefrence 'dsc' check in 'link_set_dsc_pps_packet()'
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Wed, 10 Jan 2024 15:28:35 +0000 (20:58 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Jan 2024 21:29:32 +0000 (16:29 -0500)
commit3bb9b1f958c3d986ed90a3ff009f1e77e9553207
treece9fe2d8858a6fa37df83ce62a446826cc565647
parentd7643fe6fb76edb1f2f1497bf5e8b8f4774b5129
drm/amd/display: Fix late derefrence 'dsc' check in 'link_set_dsc_pps_packet()'

In link_set_dsc_pps_packet(), 'struct display_stream_compressor *dsc'
was dereferenced in a DC_LOGGER_INIT(dsc->ctx->logger); before the 'dsc'
NULL pointer check.

Fixes the below:
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:905 link_set_dsc_pps_packet() warn: variable dereferenced before check 'dsc' (see line 903)

Cc: stable@vger.kernel.org
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Hamza Mahfooz <hamza.mahfooz@amd.com>
Cc: Wenjing Liu <wenjing.liu@amd.com>
Cc: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/link/link_dpms.c