amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: Shashank Sharma <shashank.sharma@amd.com>, amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com
Subject: Re: [PATCH] drm/amdgpu/dm: Fix NULL pointer crash during DP MST hotplug
Date: Thu, 15 Apr 2021 13:58:42 -0400	[thread overview]
Message-ID: <accf1407-9427-c49f-c8d8-3e1169678a94@amd.com> (raw)
In-Reply-To: <20210415175524.63137-1-shashank.sharma@amd.com>

On 2021-04-15 1:55 p.m., Shashank Sharma wrote:
> 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>
> Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index eee19edeeee5..8dc5005bec0a 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -226,6 +226,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;
> 

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

      reply	other threads:[~2021-04-15 17:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 17:55 [PATCH] drm/amdgpu/dm: Fix NULL pointer crash during DP MST hotplug Shashank Sharma
2021-04-15 17:58 ` Harry Wentland [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=accf1407-9427-c49f-c8d8-3e1169678a94@amd.com \
    --to=harry.wentland@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=shashank.sharma@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).