Commit 3295580d authored by Srinivasan Shanmugam's avatar Srinivasan Shanmugam Committed by Alex Deucher

drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() &...

drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() & write_dpcd()' functions

The 'status' variable in 'core_link_read_dpcd()' &
'core_link_write_dpcd()' was uninitialized.

Thus, initializing 'status' variable to 'DC_ERROR_UNEXPECTED' by default.

Fixes the below:
drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dpcd.c:226 core_link_read_dpcd() error: uninitialized symbol 'status'.
drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dpcd.c:248 core_link_write_dpcd() error: uninitialized symbol 'status'.

Cc: stable@vger.kernel.org
Cc: Jerry Zuo <jerry.zuo@amd.com>
Cc: Jun Lei <Jun.Lei@amd.com>
Cc: Wayne Lin <Wayne.Lin@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1757bb7d
...@@ -205,7 +205,7 @@ enum dc_status core_link_read_dpcd( ...@@ -205,7 +205,7 @@ enum dc_status core_link_read_dpcd(
uint32_t extended_size; uint32_t extended_size;
/* size of the remaining partitioned address space */ /* size of the remaining partitioned address space */
uint32_t size_left_to_read; uint32_t size_left_to_read;
enum dc_status status; enum dc_status status = DC_ERROR_UNEXPECTED;
/* size of the next partition to be read from */ /* size of the next partition to be read from */
uint32_t partition_size; uint32_t partition_size;
uint32_t data_index = 0; uint32_t data_index = 0;
...@@ -234,7 +234,7 @@ enum dc_status core_link_write_dpcd( ...@@ -234,7 +234,7 @@ enum dc_status core_link_write_dpcd(
{ {
uint32_t partition_size; uint32_t partition_size;
uint32_t data_index = 0; uint32_t data_index = 0;
enum dc_status status; enum dc_status status = DC_ERROR_UNEXPECTED;
while (size) { while (size) {
partition_size = dpcd_get_next_partition_size(address, size); partition_size = dpcd_get_next_partition_size(address, size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment