From: Jake Wang <haonan.wa...@amd.com>

[Why & How]
Need to check if local_sink is NULL before accessing.

Signed-off-by: Jake Wang <haonan.wa...@amd.com>
Reviewed-by: Anthony Koo <anthony....@amd.com>
Acked-by: Rodrigo Siqueira <rodrigo.sique...@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
index 6590f51caefa..93e28231a9d0 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
@@ -167,7 +167,8 @@ bool edp_receiver_ready_T9(struct dc_link *link)
                } while (++tries < 50);
        }
 
-       if (link->local_sink->edid_caps.panel_patch.extra_delay_backlight_off > 
0)
+       if (link->local_sink &&
+                       
link->local_sink->edid_caps.panel_patch.extra_delay_backlight_off > 0)
                
udelay(link->local_sink->edid_caps.panel_patch.extra_delay_backlight_off * 
1000);
 
        return result;
@@ -201,7 +202,8 @@ bool edp_receiver_ready_T7(struct dc_link *link)
                } while (time_taken_in_ns < 50 * 1000000); //MAx T7 is 50ms
        }
 
-       if (link->local_sink->edid_caps.panel_patch.extra_t7_ms > 0)
+       if (link->local_sink &&
+                       link->local_sink->edid_caps.panel_patch.extra_t7_ms > 0)
                udelay(link->local_sink->edid_caps.panel_patch.extra_t7_ms * 
1000);
 
        return result;
-- 
2.27.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to