drm/amdgpu: Fix potential null pointer derefernce
authorStanley.Yang <Stanley.Yang@amd.com>
Wed, 27 Sep 2023 08:22:29 +0000 (16:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:06:58 +0000 (17:06 +0000)
commit9b70fc7d70e8ef7c4a65034c9487f58609e708a1
tree3908ea1679aad4b333ea42a442382f0bcf59f748
parentd0725232da777840703f5f1e22f2e3081d712aa4
drm/amdgpu: Fix potential null pointer derefernce

[ Upstream commit 80285ae1ec8717b597b20de38866c29d84d321a1 ]

The amdgpu_ras_get_context may return NULL if device
not support ras feature, so add check before using.

Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c