diff options
author | Peter Crosthwaite <crosthwaitepeter@gmail.com> | 2016-01-21 14:15:04 +0000 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:28:25 -0600 |
commit | 3886d278b664ee727239a001eb5443001f950c56 (patch) | |
tree | 6f5a836eaeb5cbf4576305a8d44fd9a1747180a4 /hw/misc | |
parent | ed84b17d51d50edba0911fb5b46fdb937a43953e (diff) | |
download | hqemu-3886d278b664ee727239a001eb5443001f950c56.zip hqemu-3886d278b664ee727239a001eb5443001f950c56.tar.gz |
misc: zynq-xadc: Fix off-by-one
This bounds check was off-by-one. Fix.
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Message-id: 1453101737-11255-1-git-send-email-crosthwaite.peter@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/misc')
-rw-r--r-- | hw/misc/zynq-xadc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/misc/zynq-xadc.c b/hw/misc/zynq-xadc.c index 1a32595..d160ff2 100644 --- a/hw/misc/zynq-xadc.c +++ b/hw/misc/zynq-xadc.c @@ -220,7 +220,7 @@ static void zynq_xadc_write(void *opaque, hwaddr offset, uint64_t val, break; } - if (xadc_reg > ZYNQ_XADC_NUM_ADC_REGS && xadc_cmd != CMD_NOP) { + if (xadc_reg >= ZYNQ_XADC_NUM_ADC_REGS && xadc_cmd != CMD_NOP) { qemu_log_mask(LOG_GUEST_ERROR, "read/write op to invalid xadc " "reg 0x%x\n", xadc_reg); break; |