AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Eric Huang <jinhuieric.huang@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: fix NULL pointer in amdgpu_reset_get_desc
Date: Thu, 6 Jun 2024 23:02:03 +0530	[thread overview]
Message-ID: <1d4ee550-9bd2-4112-8eb8-94284f3c6d7e@amd.com> (raw)
In-Reply-To: <20240606154300.100140-1-jinhuieric.huang@amd.com>



On 6/6/2024 9:13 PM, Eric Huang wrote:
> amdgpu_job_ring may return NULL, which causes kernel NULL
> pointer error, using another way to print ring name instead
> of ring->name.
> 
> Suggested-by: Lijo Lazar <Lijo.Lazar@amd.com>
> Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>

Thanks,
Lijo

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> index 9deb41d61e8d..66c1a868c0e1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> @@ -164,16 +164,14 @@ void amdgpu_device_unlock_reset_domain(struct amdgpu_reset_domain *reset_domain)
>  void amdgpu_reset_get_desc(struct amdgpu_reset_context *rst_ctxt, char *buf,
>  			   size_t len)
>  {
> -	struct amdgpu_ring *ring;
> -
>  	if (!buf || !len)
>  		return;
>  
>  	switch (rst_ctxt->src) {
>  	case AMDGPU_RESET_SRC_JOB:
>  		if (rst_ctxt->job) {
> -			ring = amdgpu_job_ring(rst_ctxt->job);
> -			snprintf(buf, len, "job hang on ring:%s", ring->name);
> +			snprintf(buf, len, "job hang on ring:%s",
> +				 rst_ctxt->job->base.sched->name);
>  		} else {
>  			strscpy(buf, "job hang", len);
>  		}

      parent reply	other threads:[~2024-06-06 17:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 15:43 [PATCH] drm/amdgpu: fix NULL pointer in amdgpu_reset_get_desc Eric Huang
2024-06-06 16:36 ` Alex Deucher
2024-06-06 17:32 ` Lazar, Lijo [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=1d4ee550-9bd2-4112-8eb8-94284f3c6d7e@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=jinhuieric.huang@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