From: Felix Kuehling Date: Mon, 15 Jan 2024 21:51:46 +0000 (-0500) Subject: drm/amdgpu: Remove unnecessary NULL check X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5394fb2a5bd5c5ec8b0470649eaba7f55ef2defe;p=linux.git 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 Fixes: 50661eb1a2c8 ("drm/amdgpu: Auto-validate DMABuf imports in compute VMs") Reviewed-by: Kent Russell Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 77d015ebb201e..b7f07cc52b1b4 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))