drm/amdgpu: Fix potential null pointer derefernce
authorStanley.Yang <Stanley.Yang@amd.com>
Wed, 27 Sep 2023 08:22:29 +0000 (16:22 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 9 Oct 2023 20:52:46 +0000 (16:52 -0400)
commit80285ae1ec8717b597b20de38866c29d84d321a1
tree4600c790785a6b026f5544c3f8de54f65f1d696d
parent098c13079c6fdd44f10586b69132c392ebf87450
drm/amdgpu: Fix potential null pointer derefernce

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>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c