]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: Remove unnecessary NULL check
authorFelix Kuehling <felix.kuehling@amd.com>
Mon, 15 Jan 2024 21:51:46 +0000 (16:51 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Jan 2024 20:44:49 +0000 (15:44 -0500)
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@linaro.org>
Fixes: 50661eb1a2c8 ("drm/amdgpu: Auto-validate DMABuf imports in compute VMs")
Reviewed-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 77d015ebb201ee7e74bba9d278cb3f977bb641cc..b7f07cc52b1b4e73d664e3ada4d42172340d7494 100644 (file)
@@ -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))