[PATCH] drm/amdgpu: Remove unnecessary NULL check
Russell, Kent
Kent.Russell at amd.com
Tue Jan 16 14:14:59 UTC 2024
[AMD Official Use Only - General]
Reviewed-by: Kent Russell <kent.russell at amd.com>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Felix
> Kuehling
> Sent: Monday, January 15, 2024 5:57 PM
> To: amd-gfx at lists.freedesktop.org
> Cc: Dan Carpenter <dan.carpenter at linaro.org>
> Subject: [PATCH] drm/amdgpu: Remove unnecessary NULL check
>
> A static checker pointed out, that bo_va->base.bo was already derefenced
> earlier in the same scope. Therefore this check is unnecessary here.
>
> Reported-by: Dan Carpenter <dan.carpenter at linaro.org>
> Fixes: 79e7fdec71f2 ("drm/amdgpu: Auto-validate DMABuf imports in compute
> VMs")
> Signed-off-by: Felix Kuehling <felix.kuehling at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 77d015ebb201..b7f07cc52b1b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1477,7 +1477,7 @@ int amdgpu_vm_handle_moved(struct amdgpu_device
> *adev,
> /* Remember evicted DMABuf imports in compute VMs for later
> * validation
> */
> - if (vm->is_compute_context && bo_va->base.bo &&
> + if (vm->is_compute_context &&
> bo_va->base.bo->tbo.base.import_attach &&
> (!bo_va->base.bo->tbo.resource ||
> bo_va->base.bo->tbo.resource->mem_type ==
> TTM_PL_SYSTEM))
> --
> 2.34.1
More information about the amd-gfx
mailing list