diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-05-10 15:00:55 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-05-12 16:18:45 +1000 |
commit | 6bc8fda91a4e721c36402c356980bb63c950219e (patch) | |
tree | c3dc5cd1ce75f622b0c954f24b96f89875895812 | |
parent | 4450142f6682835394adc2f5422d3003581b5135 (diff) | |
download | skiboot-6bc8fda91a4e721c36402c356980bb63c950219e.zip skiboot-6bc8fda91a4e721c36402c356980bb63c950219e.tar.gz skiboot-6bc8fda91a4e721c36402c356980bb63c950219e.tar.bz2 |
hdata/i2c: avoid possible int32_t overflow
We're safe up until engine number 524288.
Found by static analysis
Fixes: ae4e50eb35695
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hdata/i2c.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hdata/i2c.c b/hdata/i2c.c index 24e9257..f5c5baf 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -29,7 +29,7 @@ struct i2c_dev { static struct dt_node *get_i2cm_node(struct dt_node *xscom, int engine) { - uint64_t xscom_base = P9_I2CM_XSCOM_BASE + P9_I2CM_XSCOM_SIZE * engine; + uint64_t xscom_base = P9_I2CM_XSCOM_BASE + P9_I2CM_XSCOM_SIZE * (uint64_t)engine; struct dt_node *i2cm; uint64_t freq, clock; |