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:19:41 +0000 (17:19 +0000)
commitda46e63482fdc5e35c008865c22ac64027f6f0c2
tree4061ec3b750dc82a98df27f9b813710271279269
parentb3b8b7c040cf069da7afe11c5bd73b870b8f3d18
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