[PATCH 1/3] drm/amdgpu: Fix the out-of-bounds read warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use '<' instead of '<=' to fix the out-of-bounds
read error

Signed-off-by: Ma Jun <Jun.Ma2@xxxxxxx>
---
 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
index eb25af46622e..5c08ad234439 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
@@ -144,7 +144,7 @@ static const char *mes_v11_0_get_misc_op_string(union MESAPI__MISC *x_pkt)
 	const char *op_str = NULL;
 
 	if ((x_pkt->header.opcode == MES_SCH_API_MISC) &&
-	    (x_pkt->opcode <= ARRAY_SIZE(mes_v11_0_misc_opcodes)))
+	    (x_pkt->opcode < ARRAY_SIZE(mes_v11_0_misc_opcodes)))
 		op_str = mes_v11_0_misc_opcodes[x_pkt->opcode];
 
 	return op_str;
-- 
2.34.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux