<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
Am 31.12.21 um 09:37 schrieb 温志伟:<br>
<blockquote type="cite" cite="mid:xfsceflzgr-xftmc911ak@nsmail6.0">
<p><br>
</p>
<div class="viewer_part">
<div> <br>
<p>Then the judgment in line 944 is needed. Are the
possibilities of these two positions consistent.</p>
<p>Why keep this judgment?</p>
</div>
</div>
</blockquote>
<br>
Because when mem is non-NULL bo_va->bo can't be NULL either.<br>
<br>
Regards,<br>
Christian.<br>
<br>
<blockquote type="cite" cite="mid:xfsceflzgr-xftmc911ak@nsmail6.0">
<div class="viewer_part">
<div>
<p><br>
</p>
<p>Regards,</p>
<p>Wen Zhiwei.</p>
<p><br>
</p>
<p>----</p>
<p><br>
</p>
<div id="re" style="margin-left:0.5em;padding-left:0.5em;border-left:1px
solid green;"><br>
<br>
<br>
<div style="background-color:#f5f7fa"><b>主 题:</b><span id="subject">Re: [PATCH] gpu/drm/radeon:Fix null pointer
risk</span> <br>
<b>日 期:</b><span id="date">2021-12-31 00:36</span>
<br>
<b>发件人:</b><span id="from">Christian König</span>
<br>
<b>收件人:</b><span id="to">Wen
<a class="moz-txt-link-abbreviated" href="mailto:Zhiweialexander.deucher@amd.comXinhui.Pan@amd.comairlied@linux.iedaniel@ffwll.ch">Zhiweialexander.deucher@amd.comXinhui.Pan@amd.comairlied@linux.iedaniel@ffwll.ch</a></span>
</div>
<br>
<div id="content">
<div class="viewer_part">
<div>Am 28.12.21 um 08:31 schrieb Wen Zhiwei:<br>
> If the null pointer is not judged in advance,<br>
> there is a risk that the pointer will cross<br>
> the boundary<br>
<br>
As far as I can see that case is impossible, why do
you want to add a <br>
check for it?<br>
<br>
Regards,<br>
Christian.<br>
<br>
><br>
> Signed-off-by: Wen Zhiwei<wenzhiwei@kylinos.cn><br>
> ---<br>
> drivers/gpu/drm/radeon/radeon_vm.c | 2 +-<br>
> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/drivers/gpu/drm/radeon/radeon_vm.c
b/drivers/gpu/drm/radeon/radeon_vm.c<br>
> index bb53016f3138..d3d342041adf 100644<br>
> --- a/drivers/gpu/drm/radeon/radeon_vm.c<br>
> +++ b/drivers/gpu/drm/radeon/radeon_vm.c<br>
> @@ -951,7 +951,7 @@ int
radeon_vm_bo_update(struct radeon_device *rdev,<br>
> <br>
> if (mem->mem_type == TTM_PL_TT) {<br>
> bo_va->flags |= RADEON_VM_PAGE_SYSTEM;<br>
> - if (!(bo_va->bo->flags &
(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC)))<br>
> + if (bo_va->bo &&
!(bo_va->bo->flags & (RADEON_GEM_GTT_WC |
RADEON_GEM_GTT_UC)))<br>
> bo_va->flags |= RADEON_VM_PAGE_SNOOPED;<br>
> <br>
> } else {<br>
<br>
</wenzhiwei@kylinos.cn></div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>