drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() & write_...
authorjsg <jsg@openbsd.org>
Fri, 2 Feb 2024 03:34:24 +0000 (03:34 +0000)
committerjsg <jsg@openbsd.org>
Fri, 2 Feb 2024 03:34:24 +0000 (03:34 +0000)
From Srinivasan Shanmugam
b565f41b9f20ed65d73660ffa6d8e495bc839789 in linux-6.6.y/6.6.15
a58371d632ebab9ea63f10893a6b6731196b6f8d in mainline linux

sys/dev/pci/drm/amd/display/dc/link/protocols/link_dpcd.c

index 5c9a302..fc50931 100644 (file)
@@ -205,7 +205,7 @@ enum dc_status core_link_read_dpcd(
        uint32_t extended_size;
        /* size of the remaining partitioned address space */
        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 */
        uint32_t partition_size;
        uint32_t data_index = 0;
@@ -234,7 +234,7 @@ enum dc_status core_link_write_dpcd(
 {
        uint32_t partition_size;
        uint32_t data_index = 0;
-       enum dc_status status;
+       enum dc_status status = DC_ERROR_UNEXPECTED;
 
        while (size) {
                partition_size = dpcd_get_next_partition_size(address, size);