mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: "José Expósito" <jose.exposito89@gmail.com>, shenshih@amd.com
Cc: sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch,
	nicholas.kazlauskas@amd.com, Anson.Jacob@amd.com,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
Date: Mon, 10 Jan 2022 11:34:44 -0500	[thread overview]
Message-ID: <139784cd-6cb7-18e0-bb09-b35113bd83ef@amd.com> (raw)
In-Reply-To: <20220109184245.124850-1-jose.exposito89@gmail.com>

On 2022-01-09 13:42, José Expósito wrote:
> The function performs a check on the "adev" input parameter, however, it
> is used before the check.
> 
> Initialize the "dev" variable after the sanity check to avoid a possible
> NULL pointer dereference.
> 
> Fixes: e27c41d5b0681 ("drm/amd/display: Support for DMUB HPD interrupt handling")
> Addresses-Coverity-ID: 1493909 ("Null pointer dereference")
> Signed-off-by: José Expósito <jose.exposito89@gmail.com>

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

Harry

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index e727f1dd2a9a..7fbded7a6d9c 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -656,7 +656,7 @@ void dmub_hpd_callback(struct amdgpu_device *adev, struct dmub_notification *not
>  	struct drm_connector_list_iter iter;
>  	struct dc_link *link;
>  	uint8_t link_index = 0;
> -	struct drm_device *dev = adev->dm.ddev;
> +	struct drm_device *dev;
>  
>  	if (adev == NULL)
>  		return;
> @@ -673,6 +673,7 @@ void dmub_hpd_callback(struct amdgpu_device *adev, struct dmub_notification *not
>  
>  	link_index = notify->link_index;
>  	link = adev->dm.dc->links[link_index];
> +	dev = adev->dm.ddev;
>  
>  	drm_connector_list_iter_begin(dev, &iter);
>  	drm_for_each_connector_iter(connector, &iter) {


  reply	other threads:[~2022-01-10 16:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09 18:42 José Expósito
2022-01-10 16:34 ` Harry Wentland [this message]
2022-01-10 18:37   ` Alex Deucher

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=139784cd-6cb7-18e0-bb09-b35113bd83ef@amd.com \
    --to=harry.wentland@amd.com \
    --cc=Anson.Jacob@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jose.exposito89@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=shenshih@amd.com \
    --cc=sunpeng.li@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

Powered by JetHome