drm/amd/display: Run DC_LOG_DC after checking link->link_enc
authorAlex Hung <alex.hung@amd.com>
Fri, 7 Jun 2024 15:21:30 +0000 (09:21 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jun 2024 21:10:36 +0000 (17:10 -0400)
[WHAT]
The DC_LOG_DC should be run after link->link_enc is checked, not before.

This fixes 1 REVERSE_INULL issue reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/link/link_factory.c

index 8073fdae9cb1395110c6a21c68f82e4b9c8f37ed..8246006857b30b83ea626c4cd977228e953d47d0 100644 (file)
@@ -610,14 +610,14 @@ static bool construct_phy(struct dc_link *link,
        link->link_enc =
                link->dc->res_pool->funcs->link_enc_create(dc_ctx, &enc_init_data);
 
-       DC_LOG_DC("BIOS object table - DP_IS_USB_C: %d", link->link_enc->features.flags.bits.DP_IS_USB_C);
-       DC_LOG_DC("BIOS object table - IS_DP2_CAPABLE: %d", link->link_enc->features.flags.bits.IS_DP2_CAPABLE);
-
        if (!link->link_enc) {
                DC_ERROR("Failed to create link encoder!\n");
                goto link_enc_create_fail;
        }
 
+       DC_LOG_DC("BIOS object table - DP_IS_USB_C: %d", link->link_enc->features.flags.bits.DP_IS_USB_C);
+       DC_LOG_DC("BIOS object table - IS_DP2_CAPABLE: %d", link->link_enc->features.flags.bits.IS_DP2_CAPABLE);
+
        /* Update link encoder tracking variables. These are used for the dynamic
         * assignment of link encoders to streams.
         */