<p></p><p></p><p></p><p></p><p><br></p><p></p><p></p><p></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><p><br></p><p>Regards,</p><p>Wen Zhiwei.</p><p><br></p> <p>----</p><p></p><p><br></p><p></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 Zhiweialexander.deucher@amd.comXinhui.Pan@amd.comairlied@linux.iedaniel@ffwll.ch</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>