drm/amd/display: Guard against NULL link encoder in log hw state
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Mon, 13 Jun 2022 19:11:04 +0000 (15:11 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Jul 2022 20:13:42 +0000 (16:13 -0400)
[Why & How]
Check lenc is not NULL since dynamic link encoder assignment could
end up assigning a NULL link encoder.

Reviewed-by: Michael Strauss <Michael.Strauss@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@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/dcn10/dcn10_hw_sequencer.c

index aaa0bf321bce6ef5760dfffaf925e54ea2776d47..029deb81fcfaa2195a3a956ebbfb460b4fb05228 100644 (file)
@@ -444,7 +444,7 @@ void dcn10_log_hw_state(struct dc *dc,
 
                struct link_enc_state s = {0};
 
-               if (lenc->funcs->read_state) {
+               if (lenc && lenc->funcs->read_state) {
                        lenc->funcs->read_state(lenc, &s);
                        DTN_INFO("[%-3d]: %-12d %-22d %-22d %-25d\n",
                                i,