diff options
| author | Christian König <[email protected]> | 2023-10-06 12:04:04 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-10-09 21:59:29 +0000 |
| commit | ff89f064dca38e2203790bf876cc7756b8ab2961 (patch) | |
| tree | 628ba1c9aa72cc4231d1c91c3a4997b0dbbdffa0 | |
| parent | drm/amd/display: Don't set dpms_off for seamless boot (diff) | |
| download | kernel-ff89f064dca38e2203790bf876cc7756b8ab2961.tar.gz kernel-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 <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
CC: [email protected]
| -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); |
