]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: fix NULL pointer issue buffer funcs
authorLikun Gao <Likun.Gao@amd.com>
Fri, 12 Jul 2024 03:07:40 +0000 (11:07 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Dec 2025 18:56:28 +0000 (13:56 -0500)
If SDMA block not enabled, buffer_funcs will not initialize,
fix the null pointer issue if buffer_funcs not initialized.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 903c4706040d2f365888aa79d2861fd3128e3455..c8d1e5565c31fbfcc850506cba7cfc9d452b6ced 100644 (file)
@@ -3311,7 +3311,8 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
        if (r)
                goto init_failed;
 
-       if (adev->mman.buffer_funcs_ring->sched.ready)
+       if (adev->mman.buffer_funcs_ring &&
+           adev->mman.buffer_funcs_ring->sched.ready)
                amdgpu_ttm_set_buffer_funcs_status(adev, true);
 
        /* Don't init kfd if whole hive need to be reset during init */