i2c: qup: Fix wrong value of index variable
authorSricharan R <[email protected]>
Fri, 10 Jun 2016 18:08:20 +0000 (23:38 +0530)
committerWolfram Sang <[email protected]>
Sat, 18 Jun 2016 16:33:13 +0000 (18:33 +0200)
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 <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
Cc: [email protected]
drivers/i2c/busses/i2c-qup.c

index cc6439ab3f714145f4d86c49c3d3c79716a058b1..041050edd80991713d9bb5a776c9a1d402f23bf5 100644 (file)
@@ -1268,6 +1268,8 @@ static int qup_i2c_xfer_v2(struct i2c_adapter *adap,
                }
        }
 
+       idx = 0;
+
        do {
                if (msgs[idx].len == 0) {
                        ret = -EINVAL;