mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Wen Zhiwei <wenzhiwei@kylinos.cn>,
	alexander.deucher@amd.com, Xinhui.Pan@amd.com, airlied@linux.ie,
	daniel@ffwll.ch
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpu/drm/radeon:Fix null pointer risk
Date: Thu, 30 Dec 2021 17:36:58 +0100	[thread overview]
Message-ID: <ec202938-5972-d74e-a17c-256420350eb8@amd.com> (raw)
In-Reply-To: <20211228073126.48906-1-wenzhiwei@kylinos.cn>

Am 28.12.21 um 08:31 schrieb Wen Zhiwei:
> If the null pointer is not judged in advance,
> there is a risk that the pointer will cross
> the boundary

As far as I can see that case is impossible, why do you want to add a 
check for it?

Regards,
Christian.

>
> Signed-off-by: Wen Zhiwei <wenzhiwei@kylinos.cn>
> ---
>   drivers/gpu/drm/radeon/radeon_vm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
> index bb53016f3138..d3d342041adf 100644
> --- a/drivers/gpu/drm/radeon/radeon_vm.c
> +++ b/drivers/gpu/drm/radeon/radeon_vm.c
> @@ -951,7 +951,7 @@ int radeon_vm_bo_update(struct radeon_device *rdev,
>   
>   		if (mem->mem_type == TTM_PL_TT) {
>   			bo_va->flags |= RADEON_VM_PAGE_SYSTEM;
> -			if (!(bo_va->bo->flags & (RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC)))
> +			if (bo_va->bo && !(bo_va->bo->flags & (RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC)))
>   				bo_va->flags |= RADEON_VM_PAGE_SNOOPED;
>   
>   		} else {


      reply	other threads:[~2021-12-30 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-28  7:31 Wen Zhiwei
2021-12-30 16:36 ` Christian König [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=ec202938-5972-d74e-a17c-256420350eb8@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wenzhiwei@kylinos.cn \
    /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

all inboxes | Powered by JetHome®