diff options
author | Cédric Le Goater <clg@kaod.org> | 2023-11-09 18:15:25 +0100 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2023-11-21 08:39:57 +0100 |
commit | 8bc5ae046d15fcd3e5de65225d5d3a8f1a5a6413 (patch) | |
tree | 46e6800ea060c132338f3e0c093e8b1add6765ed /.gitpublish | |
parent | af9264da80073435fd78944bc5a46e695897d7e5 (diff) |
ppc/pnv: Fix potential overflow in I2C model
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>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Glenn Miles <milesg@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to '.gitpublish')
0 files changed, 0 insertions, 0 deletions