diff options
| author | Christian König <[email protected]> | 2023-10-06 12:04:04 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-10-09 21:01:32 +0000 |
| commit | 31220ee9dc5a3e25d38d29d3816b6e79d8c39abc (patch) | |
| tree | bc93ed30c10dceb7425c9d9ff4efb38f91b32804 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | |
| parent | drm/amd/display: 3.2.255 (diff) | |
| download | kernel-31220ee9dc5a3e25d38d29d3816b6e79d8c39abc.tar.gz kernel-31220ee9dc5a3e25d38d29d3816b6e79d8c39abc.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]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.h')
| -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); |
