Blob Blame History Raw
From d0035c3031b0d5a1cbb300d698328d118af33d3e Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Sun, 23 Dec 2018 22:12:36 +0000
Subject: [PATCH 08/27] aio: fix off-by-one error in indexed xlat lookup

* aio.c (tprint_lio_opcode): Decrement xlat size by one to account
for XLAT_END as other users of indexed xlats do.

Fixes: v4.24~71 "aio: print IOCB_CMD_* using xlat"
---
 aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aio.c b/aio.c
index a07d8eb..24ad69f 100644
--- a/aio.c
+++ b/aio.c
@@ -70,7 +70,7 @@ tprint_lio_opcode(unsigned int cmd)
 		[IOCB_CMD_PWRITEV]	= SUB_VECTOR,
 	};
 
-	printxval_indexn_ex(ARRSZ_PAIR(aio_cmds), cmd, "IOCB_CMD_???",
+	printxval_indexn_ex(ARRSZ_PAIR(aio_cmds) - 1, cmd, "IOCB_CMD_???",
 			    XLAT_STYLE_FMT_U);
 
 	return cmd < ARRAY_SIZE(subs) ? subs[cmd] : SUB_NONE;
-- 
2.1.4