]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/radeon: check bo_va->bo is non-NULL before using it
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 25 Jun 2024 12:31:34 +0000 (14:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Feb 2025 17:22:30 +0000 (18:22 +0100)
commit 6fb15dcbcf4f212930350eaee174bb60ed40a536 upstream.

The call to radeon_vm_clear_freed might clear bo_va->bo, so
we have to check it before dereferencing it.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/radeon/radeon_gem.c

index 75053917d2137e8d82040edee04b0ab92803d684..51b6f38b5c474eea0b53199d1adf9975d7dae7e9 100644 (file)
@@ -582,7 +582,7 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev,
        if (r)
                goto error_unlock;
 
-       if (bo_va->it.start)
+       if (bo_va->it.start && bo_va->bo)
                r = radeon_vm_bo_update(rdev, bo_va, &bo_va->bo->tbo.mem);
 
 error_unlock: