Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Christian König and committed by
Alex Deucher
31220ee9 dcc71a7e

+1 -1
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
··· 252 252 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); 253 253 struct amdgpu_res_cursor cursor; 254 254 255 - if (bo->tbo.resource->mem_type != TTM_PL_VRAM) 255 + if (!bo->tbo.resource || bo->tbo.resource->mem_type != TTM_PL_VRAM) 256 256 return false; 257 257 258 258 amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &cursor);