From 6bc8fda91a4e721c36402c356980bb63c950219e Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Wed, 10 May 2017 15:00:55 +1000 Subject: 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 --- hdata/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hdata') 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; -- cgit v1.1