aboutsummaryrefslogtreecommitdiff
path: root/module-common.c
diff options
context:
space:
mode:
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>2024-11-04 09:38:38 -0300
committerAlistair Francis <alistair.francis@wdc.com>2024-11-07 08:18:17 +1000
commitcd5d265f42fbb1d29cbc9d8805821149101c1d23 (patch)
tree4e7109e8d475ae3e27079f867e126fa22d90e1c8 /module-common.c
parentb069018e2fe1fc613f5eeecc810050210e845528 (diff)
downloadqemu-cd5d265f42fbb1d29cbc9d8805821149101c1d23.zip
qemu-cd5d265f42fbb1d29cbc9d8805821149101c1d23.tar.gz
qemu-cd5d265f42fbb1d29cbc9d8805821149101c1d23.tar.bz2
hw/riscv/riscv-iommu: change 'depth' to int
Coverity reports an unsigned overflow when doing: for (; depth-- > 0; ) { When depth = 0 inside riscv_iommu_ctx_fetch(). Building it with a recent GCC the code doesn't actually break with depth = 0, i.e. the comparison "0-- > 0" will exit the loop instead of proceeding, but 'depth' will retain the overflow value afterwards. This behavior can be compiler dependent, so change 'depth' to int to remove this potential ambiguity. Resolves: Coverity CID 1564783 Fixes: 0c54acb8243 ("hw/riscv: add RISC-V IOMMU base emulation") Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20241104123839.533442-2-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'module-common.c')
0 files changed, 0 insertions, 0 deletions