drm/amd/display: prevent reading unitialized links
[why/how] The function can be called on boot or after suspend when links are not initialized, to prevent it guard it with NULL pointer check Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by: Pavle Kotarac <Pavle.Kotarac@amd.com> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
af6902ec41
commit
0755c38eb0
|
@ -226,6 +226,8 @@ static inline void get_edp_links(const struct dc *dc,
|
|||
*edp_num = 0;
|
||||
for (i = 0; i < dc->link_count; i++) {
|
||||
// report any eDP links, even unconnected DDI's
|
||||
if (!dc->links[i])
|
||||
continue;
|
||||
if (dc->links[i]->connector_signal == SIGNAL_TYPE_EDP) {
|
||||
edp_links[*edp_num] = dc->links[i];
|
||||
if (++(*edp_num) == MAX_NUM_EDP)
|
||||
|
|
Loading…
Reference in New Issue