Commit b42fee5e authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amdgpu: fix error checking in amdgpu_read_mm_registers for nv

Properly skip non-existent registers as well.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2442


Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent 2915e43a
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -444,8 +444,9 @@ static int nv_read_register(struct amdgpu_device *adev, u32 se_num,
	*value = 0;
	for (i = 0; i < ARRAY_SIZE(nv_allowed_read_registers); i++) {
		en = &nv_allowed_read_registers[i];
		if (adev->reg_offset[en->hwip][en->inst] &&
		    reg_offset != (adev->reg_offset[en->hwip][en->inst][en->seg]
		if (!adev->reg_offset[en->hwip][en->inst])
			continue;
		else if (reg_offset != (adev->reg_offset[en->hwip][en->inst][en->seg]
					+ en->reg_offset))
			continue;