All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Friedrich Vock <friedrich.vock@gmx.de>, amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Check if NBIO funcs are NULL in amdgpu_device_baco_exit
Date: Tue, 14 May 2024 09:21:01 +0200	[thread overview]
Message-ID: <42cc0287-09da-4d71-91e9-685287fb56ca@amd.com> (raw)
In-Reply-To: <20240514070638.199124-1-friedrich.vock@gmx.de>

Am 14.05.24 um 09:06 schrieb Friedrich Vock:
> The special case for VM passthrough doesn't check adev->nbio.funcs
> before dereferencing it. If GPUs that don't have an NBIO block are
> passed through, this leads to a NULL pointer dereference on startup.
>
> Signed-off-by: Friedrich Vock <friedrich.vock@gmx.de>

Acked-by: Christian König <christian.koenig@amd.com>

>
> Fixes: 1bece222eab ("drm/amdgpu: Clear doorbell interrupt status for Sienna Cichlid")
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 861ccff78af95..83c4533ee75c8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -6165,7 +6165,7 @@ int amdgpu_device_baco_exit(struct drm_device *dev)
>   	    adev->nbio.funcs->enable_doorbell_interrupt)
>   		adev->nbio.funcs->enable_doorbell_interrupt(adev, true);
>
> -	if (amdgpu_passthrough(adev) &&
> +	if (amdgpu_passthrough(adev) && adev->nbio.funcs &&
>   	    adev->nbio.funcs->clear_doorbell_interrupt)
>   		adev->nbio.funcs->clear_doorbell_interrupt(adev);
>
> --
> 2.45.0
>


  reply	other threads:[~2024-05-14  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14  7:06 [PATCH] drm/amdgpu: Check if NBIO funcs are NULL in amdgpu_device_baco_exit Friedrich Vock
2024-05-14  7:21 ` Christian König [this message]
2024-05-14 13:57   ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2024-08-15 14:17 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=42cc0287-09da-4d71-91e9-685287fb56ca@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=friedrich.vock@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.