mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 08:08:54 +00:00
drm/amdgpu/dm: Fix NULL pointer crash during DP MST hotplug
This patch checks the return value of the function dc_link_add_remote_sink before using it. This was causing a crash during consecutive hotplugs of DP MST displays. Cc: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Shashank Sharma <shashank.sharma@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
fe18017839
commit
ea9bc8b928
1 changed files with 5 additions and 0 deletions
|
@ -229,6 +229,11 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector)
|
|||
(aconnector->edid->extensions + 1) * EDID_LENGTH,
|
||||
&init_params);
|
||||
|
||||
if (!dc_sink) {
|
||||
DRM_ERROR("Unable to add a remote sink\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
dc_sink->priv = aconnector;
|
||||
/* dc_link_add_remote_sink returns a new reference */
|
||||
aconnector->dc_sink = dc_sink;
|
||||
|
|
Loading…
Reference in a new issue