Coverity warns that "i2c_bus_busy(i2c->busses[i]) << i" might overflow
because the expression is evaluated using 32-bit arithmetic and then
used in a context expecting a uint64_t.
While we are at it, introduce a PNV_I2C_MAX_BUSSES constant and check
the number of busses at realize time.
Fixes: Coverity CID 1523918
Cc: Glenn Miles <milesg@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
v2: - check PNV_I2C_MAX_BUSSES in realize
- removed extra space before cast.
hw/ppc/pnv_i2c.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)