hw/intc/arm_gicv3_its: Check indexes before use, not after
commitb13148d91805143aba3e0b4441e760b9bea03b8c
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 11 Jan 2022 17:10:47 +0000 (11 17:10 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 20 Jan 2022 16:04:58 +0000 (20 16:04 +0000)
tree990b1c9f9c67e48d9448b27a1b98d469e65098db
parentd050f80f8c9b4e535bf2f20d5a400c231e7a5838
hw/intc/arm_gicv3_its: Check indexes before use, not after

In a few places in the ITS command handling functions, we were
doing the range-check of an event ID or device ID only after using
it as a table index; move the checks to before the uses.

This misordering wouldn't have very bad effects because the
tables are in guest memory anyway.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20220111171048.3545974-13-peter.maydell@linaro.org
hw/intc/arm_gicv3_its.c