Browse Source

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"
Dmitry V. Levin 11 months ago
parent
commit
986a55423e
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      aio.c

+ 1
- 1
aio.c View File

@@ -50,7 +50,7 @@ tprint_lio_opcode(unsigned int cmd)
50 50
 		[IOCB_CMD_PWRITEV]	= SUB_VECTOR,
51 51
 	};
52 52
 
53
-	printxval_indexn_ex(ARRSZ_PAIR(aio_cmds), cmd, "IOCB_CMD_???",
53
+	printxval_indexn_ex(ARRSZ_PAIR(aio_cmds) - 1, cmd, "IOCB_CMD_???",
54 54
 			    XLAT_STYLE_FMT_U);
55 55
 
56 56
 	return cmd < ARRAY_SIZE(subs) ? subs[cmd] : SUB_NONE;

Loading…
Cancel
Save