diff options
author | Christian König <christian.koenig@amd.com> | 2023-10-06 14:04:04 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-10-09 17:59:29 -0400 |
commit | ff89f064dca38e2203790bf876cc7756b8ab2961 (patch) | |
tree | 628ba1c9aa72cc4231d1c91c3a4997b0dbbdffa0 /drivers/gpu/drm | |
parent | 23645bca98304a2772f0de96f97370dd567d0ae6 (diff) | |
download | linux-ff89f064dca38e2203790bf876cc7756b8ab2961.tar.gz linux-ff89f064dca38e2203790bf876cc7756b8ab2961.tar.bz2 linux-ff89f064dca38e2203790bf876cc7756b8ab2961.zip |
drm/amdgpu: add missing NULL check
bo->tbo.resource can easily be NULL here.
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2902
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index f3ee83cdf97e..d28e21baef16 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h @@ -252,7 +252,7 @@ static inline bool amdgpu_bo_in_cpu_visible_vram(struct amdgpu_bo *bo) struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); struct amdgpu_res_cursor cursor; - if (bo->tbo.resource->mem_type != TTM_PL_VRAM) + if (!bo->tbo.resource || bo->tbo.resource->mem_type != TTM_PL_VRAM) return false; amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &cursor); |