]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: the warning dereferencing obj for nbio_v7_4
authorJesse Zhang <jesse.zhang@amd.com>
Mon, 13 May 2024 07:22:42 +0000 (15:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:06:40 +0000 (11:06 +0200)
[ Upstream commit d190b459b2a4304307c3468ed97477b808381011 ]

if ras_manager obj null, don't print NBIO err data

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Suggested-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c

index eadc9526d33fe6418c2c0606a6e90e9a194c9f5b..b81572dc115f7c1b05cd65b947ab76952e426e6d 100644 (file)
@@ -313,7 +313,7 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_device
                                                RAS_CNTLR_INTERRUPT_CLEAR, 1);
                WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl);
 
-               if (!ras->disable_ras_err_cnt_harvest) {
+               if (ras && !ras->disable_ras_err_cnt_harvest && obj) {
                        /*
                         * clear error status after ras_controller_intr
                         * according to hw team and count ue number