Commit 5488deee authored by Dan Carpenter's avatar Dan Carpenter Committed by Wenyu Huang
Browse files

drm/amdgpu: Fix signedness bug in sdma_v4_0_process_trap_irq()

stable inclusion
from stable-v5.10.223
commit a5224e2123ce21102f346f518db80f004d5053a7
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IA8AED
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=a5224e2123ce21102f346f518db80f004d5053a7



--------------------------------

commit 6769a23697f17f9bf9365ca8ed62fe37e361a05a upstream.

The "instance" variable needs to be signed for the error handling to work.

Fixes: 8b2faf1a4f3b ("drm/amdgpu: add error handle to avoid out-of-bounds")
Reviewed-by: default avatarBob Zhou <bob.zhou@amd.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: Siddh Raman Pant <siddh.raman.pant@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWenyu Huang <huangwenyu5@huawei.com>
parent ed027d38
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2069,7 +2069,7 @@ static int sdma_v4_0_process_trap_irq(struct amdgpu_device *adev,
				      struct amdgpu_irq_src *source,
				      struct amdgpu_iv_entry *entry)
{
	uint32_t instance;
	int instance;

	DRM_DEBUG("IH: SDMA trap\n");
	instance = sdma_v4_0_irq_id_to_seq(entry->client_id);