dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling@amd.com>
To: "Colin King" <colin.king@canonical.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Mukul Joshi" <mukul.joshi@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] drm/amdkfd: fix a dereference of pdd before it is null checked
Date: Thu, 28 May 2020 22:06:14 -0400	[thread overview]
Message-ID: <dc37cf9d-ddaf-94c7-8fc1-460c8da59d7b@amd.com> (raw)
In-Reply-To: <20200528222453.536137-1-colin.king@canonical.com>

On 2020-05-28 18:24, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently pointer pdd is being dereferenced when assigning pointer
> dpm and then pdd is being null checked.  Fix this by checking if
> pdd is null before the dereference of pdd occurs.
>
> Addresses-Coverity: ("Dereference before null check")
> Fixes: 522b89c63370 ("drm/amdkfd: Track SDMA utilization per process")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>

I applied the patch to our internal amd-staging-drm-next.

Regards,
   Felix


> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_process.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> index 25636789f3d3..bdc58741b32e 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> @@ -103,10 +103,11 @@ static void kfd_sdma_activity_worker(struct work_struct *work)
>   		return;
>   
>   	pdd = workarea->pdd;
> +	if (!pdd)
> +		return;
>   	dqm = pdd->dev->dqm;
>   	qpd = &pdd->qpd;
> -
> -	if (!pdd || !dqm || !qpd)
> +	if (!dqm || !qpd)
>   		return;
>   
>   	mm = get_task_mm(pdd->process->lead_thread);
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2020-05-29  2:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 22:24 [PATCH][next] drm/amdkfd: fix a dereference of pdd before it is null checked Colin King
2020-05-29  2:06 ` Felix Kuehling [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=dc37cf9d-ddaf-94c7-8fc1-460c8da59d7b@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=colin.king@canonical.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mukul.joshi@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).