i2c: qup: Fix wrong value of index variable
authorSricharan R <sricharan@codeaurora.org>
Fri, 10 Jun 2016 18:08:20 +0000 (23:38 +0530)
committerWolfram Sang <wsa@the-dreams.de>
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 <sricharan@codeaurora.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
drivers/i2c/busses/i2c-qup.c

index cc6439a..041050e 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;