From: Sricharan R Date: Fri, 10 Jun 2016 18:08:20 +0000 (+0530) Subject: i2c: qup: Fix wrong value of index variable X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d4f56c7773483b8829e89cfc739b7a5a071f6da0;p=linux-beck.git i2c: qup: Fix wrong value of index variable index gets incremented during check to determine if the messages can be transferred with dma. But not reset after that, resulting in wrong start value in subsequent loop, causing failure. Fix it. Signed-off-by: Sricharan R Signed-off-by: Wolfram Sang Cc: stable@kernel.org --- diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c index cc6439ab3f71..041050edd809 100644 --- a/drivers/i2c/busses/i2c-qup.c +++ b/drivers/i2c/busses/i2c-qup.c @@ -1268,6 +1268,8 @@ static int qup_i2c_xfer_v2(struct i2c_adapter *adap, } } + idx = 0; + do { if (msgs[idx].len == 0) { ret = -EINVAL;