Skip to content

Commit ea7596e

Browse files
ChristianKoenigAMDgregkh
authored andcommitted
drm/amdgpu: add missing NULL check
commit ff89f06 upstream. 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] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d8bb786 commit ea7596e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static inline bool amdgpu_bo_in_cpu_visible_vram(struct amdgpu_bo *bo)
250250
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
251251
struct amdgpu_res_cursor cursor;
252252

253-
if (bo->tbo.resource->mem_type != TTM_PL_VRAM)
253+
if (!bo->tbo.resource || bo->tbo.resource->mem_type != TTM_PL_VRAM)
254254
return false;
255255

256256
amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &cursor);

0 commit comments

Comments
 (0)