[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240801003256.3937416-13-sashal@kernel.org>
Date: Wed, 31 Jul 2024 20:31:03 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Asad Kamal <asad.kamal@....com>,
Christian König <christian.koenig@....com>,
Lijo Lazar <lijo.lazar@....com>,
Alex Deucher <alexander.deucher@....com>,
Sasha Levin <sashal@...nel.org>,
Xinhui.Pan@....com,
airlied@...il.com,
daniel@...ll.ch,
Hawking.Zhang@....com,
mario.limonciello@....com,
candice.li@....com,
Jun.Ma2@....com,
victorchengchi.lu@....com,
andrealmeid@...lia.com,
hamza.mahfooz@....com,
amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org
Subject: [PATCH AUTOSEL 5.15 13/47] drm/amd/amdgpu: Check tbo resource pointer
From: Asad Kamal <asad.kamal@....com>
[ Upstream commit 6cd2b872643bb29bba01a8ac739138db7bd79007 ]
Validate tbo resource pointer, skip if NULL
Signed-off-by: Asad Kamal <asad.kamal@....com>
Reviewed-by: Christian König <christian.koenig@....com>
Reviewed-by: Lijo Lazar <lijo.lazar@....com>
Signed-off-by: Alex Deucher <alexander.deucher@....com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 5f6c32ec674d3..1175b0767e071 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -4406,7 +4406,8 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
shadow = vmbo->shadow;
/* No need to recover an evicted BO */
- if (shadow->tbo.resource->mem_type != TTM_PL_TT ||
+ if (!shadow->tbo.resource ||
+ shadow->tbo.resource->mem_type != TTM_PL_TT ||
shadow->tbo.resource->start == AMDGPU_BO_INVALID_OFFSET ||
shadow->parent->tbo.resource->mem_type != TTM_PL_VRAM)
continue;
--
2.43.0
Powered by blists - more mailing lists